How to get SAS File name

Reply
Contributor
Posts: 22

How to get SAS File name

Hi All,

I am executing multiple SAS code which are to heavy .

I am storing the Logs to an extenal text file. system is creating many log file i am confused which program is having which log file. So , Which i want to do is when i execute a SAS code by name firstprogram.SAS same name is to be taken by Log file fristprogram.log.

Thanks in advance.

SASPro

Super User
Super User
Posts: 7,039

Re: How to get SAS File name

How are you executing the programs.  If you have a program stored as a .sas file (say filename.sas) and execute it from the command line using command syntax like:  sas filename then SAS will automatically name the log file as filename.log .

Contributor
Posts: 22

Re: How to get SAS File name

Hi Tom,

Thanks you Tom for getting back

I am executing the code by submit button(F3)

Super User
Posts: 10,019

Re: How to get SAS File name

%let x= %sysget(SAS_EXECFILENAME);

%put &x ;

%let y= %sysget(SAS_EXECFILEPATH);

%put &y ;

Ksharp

Contributor
Posts: 22

Re: How to get SAS File name

Thank u Ksharp

i am geting filename.SAS i wan to remove the extension.

Contributor
Posts: 22

Re: How to get SAS File name

Hey i got it

Thank you

%let name = %sysfunc(scan(%sysget(SAS_EXECFILENAME),1,'.'));

Ask a Question
Discussion stats
  • 5 replies
  • 206 views
  • 4 likes
  • 3 in conversation