I don't have SDD so can't test but if running these lines of code after you have saved a program file:
%put Submitted file path is %sysget(SAS_EXECFILEPATH).;
%put Submitted file name is %sysget(SAS_EXECFILENAME).;
gives the values then you can use the %sysget() with the environment variable to play with.