DATA Step, Macro, Functions and more

Capturing the current file name of the running SAS program

Reply
SAS Employee
Posts: 21

Capturing the current file name of the running SAS program

Hi everyone,

I am looking for a way to "capture" the file name of the current running SAS batch program.
For example, assume SAS is run in batch and this program should create output files. Assume also the SAS code is in the following location: "c:\sas\demo1.sas". When the code runs I want to know that the path and filename - that is "c:\sas\demo1.sas".

Does anyone know if this is possible?

Thanks,
Eyal
SAS Super FREQ
Posts: 8,739

Re: Capturing the current file name of the running SAS program

Hi,
If you go to support.sas.com and search on the string
current file name batch program


This Tech Support note is the 3rd hit on the page
http://support.sas.com/kb/24/301.html

cynthia
SAS Employee
Posts: 21

Re: Capturing the current file name of the running SAS program

Thanks for the prompt reply !!

Eyal
N/A
Posts: 0

Re: Capturing the current file name of the running SAS program

[pre]
%let dummy = &sysprocessname ;
%put SysProcessName = &dummy ;
%put SysProcName = &SysProcName ;
%put SysStartName = &SysStartName ;
%put SysUserID = &SysUserID ;
[/pre]
Ask a Question
Discussion stats
  • 3 replies
  • 150 views
  • 0 likes
  • 3 in conversation