BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

1) I know a SAS code written in UNIX has used following option to print working directory in SAS output.

%sysget(PWD)

I am looking for similar option for windows which can print my windows directory in my SAS output. I also like to know if there is any option available, how will it print the output. It will print "C:/USER" or if I am working on shared drive it will print "//mxit12/USER".

2) I also like to know the macro variable or any other option to print the name of current SAS code I am running in output. For example if I am running code jig1.sas then it will print jig1.sas in output and then next I am running jig2.sas, it should print jig2.sas in output. I thought following macro variable does the same.

%sysfunc(scan(&SYSPROCESSNAME,2))

But it always gives me "PROCESS" in return instead of SAS code name.

Thanks,

Jig.
2 REPLIES 2
LawrenceHW
Quartz | Level 8
SYSPROCESNAME will return DMS Process if you're executing interactive SAS which is what (I suspect) is happening here.

SYSPROCESSNAME will return the program path and filename when batch executing.

You can check what SYSPROCESSNAME gives you in the LOG file but submitting "%PUT &SYSPROCESSNAME;" in the program editor.

Lawrence Message was edited by: LawrenceHW

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
  • 2 replies
  • 640 views
  • 0 likes
  • 2 in conversation