Question

Are there any generic suggestions for identifying the SAS code / program that is being executed?

My code will execute within a generic macro, so could be called within a Stored Process, another macro, a client SAS program, or even SAS code generated via the mid-tier using IOM. I'd like the highest level identifier possible.. (something that will return the same result if the same program is run again - so process id would not be helpful).

The environment is not windows, so this code is not helpful:

%put %sysget(SAS_EXECFILENAME);

Also, the macro is not necessarily the first program that is called (if it is even a program) - so neither is this code helpful:

proc sql noprint;
select xpath into :progname
from sashelp.vextfl where upcase(xpath) like '%.SAS';
%put &progname;
Was it helpful?

Solution

It sounds to me like you may need to think through how this is to be be used a little more. What if the same user has two sessions open running the same code? Should that use the same file name?

Can you simply make it a requirement of your piece of code that a certain variable must have been specified before your code will run? Otherwise return an error / abort further processing?

To answer your original question though I don't think this is possible.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top