%0 will only get the current label name, I'm pretty sure the op want the label name it was called from.
Perhaps this leads to a better solution, simply calling the label with %0
CALL :SUB_PING "%~0"
ping /l 1 /n 5 %HOST%>NUL
now I want to log to to different logfiles
depending on what subrutine I started this from
if "%~1" == ":SUB_Clean" echo the files are
if "%~1" == ":SUB_FTP" echo This files
where on the ftp>>%LOG%
Batch Variable how to