BookmarkSubscribeRSS Feed
SasPro
Calcite | Level 5

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

5 REPLIES 5
Tom
Super User Tom
Super User

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 .

SasPro
Calcite | Level 5

Hi Tom,

Thanks you Tom for getting back

I am executing the code by submit button(F3)

Ksharp
Super User

%let x= %sysget(SAS_EXECFILENAME);

%put &x ;

%let y= %sysget(SAS_EXECFILEPATH);

%put &y ;

Ksharp

SasPro
Calcite | Level 5

Thank u Ksharp

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

SasPro
Calcite | Level 5

Hey i got it

Thank you

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 781 views
  • 4 likes
  • 3 in conversation