Is there a way to obtain the current SAS program path and filename from within a SAS session. When batch submitting, this is stored in the SYSIN option, but I was hoping there is a way to find this when in SAS itself (that is, not batch submitting a program.)
In SAS 9, there is a new environment variable for the Enhanced Editor named SAS_EXECFILENAME, then you can retrieve the name of the current program by issuing this statement:
%put The current program is %sysget(SAS_EXECFILENAME);
There is also an environment variable for the Enhanced Editor called SAS_EXECFILEPATH that contains the full path of the submitted program or catalog entry. The full path includes the folder and the filename.
%put The current path is %sysget(SAS_EXECFILEPATH);