Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the filename and filepath of the code running

Tags:

sas

I need to get the current running SAS program's name and file path into local variables. I accomplished that using the SAS_EXECFILEPATH and SAS_EXECFILEPATH commands. I ran this through windows SAS and it worked.

But when i tried to run this on the server in batch mode, it failed. I then tried the &_SASPROGRAMFILE parameter, which ran fine on SAS EG, but fails when I trigger it on the server in batch mode.

Is there a possible way to accomplish this in batch mode on the server?

like image 313
Rhea Avatar asked Sep 15 '25 01:09

Rhea


1 Answers

You might be looking for %sysfunc(getoption(sysin)) (Usage Note 24301: How to retrieve the program name that is currently running in batch mode or interactively), if you start the program with sas -sysin path/to/file.sas.

like image 100
Nickolay Avatar answered Sep 17 '25 19:09

Nickolay