DATA Step, Macro, Functions and more

Looking for Windows option similar as UNIX option

Reply
N/A
Posts: 0

Looking for Windows option similar as UNIX option

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.
N/A
Posts: 0

Re: Looking for Windows option similar as UNIX option

Contributor
Posts: 49

Re: Looking for Windows option similar as UNIX option

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
Ask a Question
Discussion stats
  • 2 replies
  • 147 views
  • 0 likes
  • 2 in conversation