In reply to Cedric.

This macro var is populated only if the program is linked to a file associated with the server you're running on, and not just "embedded" in the project. In that case you could sub in the value of %_CLIENTTASKLABEL.

%macro isBlank(param);
%sysevalf(%superq(param)=,boolean)
%mend isBlank;
%macro assignfilename;
%if not %symexist(_sasprogramfile) or %isblank(&_sasprogramfile) %then
%let _sasprogramfile=&_clienttasklabel;
%mend;

%assignfilename;
%put &_sasprogramfile;