Hi
How can I get path of the program located in Unix server?
Thanks
John
Start by talking to your admin. only they know for sure because your server is your server not the worlds server.
Sorry I was not clear, I meant to say to get the location of the sas program automatically programmatically
@SASSLICK001 wrote:
Sorry I was not clear, I meant to say to get the location of the sas program automatically programmatically
What SAS program?
How are you running it?
If you just open interactive SAS and type in some code and submit it there is no program file to find.
I guess you are talking about getting the path via code.
I found another answer to that here: https://communities.sas.com/t5/SAS-Programming/unix-sas-get-path-of-current-program/td-p/473865
Pasting the accepted solution here:
There may be other ways, but you could certainly get it from &PATHNAME:
%let n_remove = %length(%scan(&pathname, -1, /));
%let pathname = %substr(&pathname, 1, %length(&pathname) - &n_remove - 1);
The extra -1 at the end removes the final / before the file name.
Do you run your program in batch, from Display Manager, from Enterprise Guide or from SAS Studio?
Enterprise Guide provides the filename of the loaded program in macro variable _sasprogramfile.
Display Manager does not provide a mechanism for this.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.