BookmarkSubscribeRSS Feed
SASSLICK001
Obsidian | Level 7

Hi 

 

How can I get path of the program located in Unix server?

 

Thanks

John

8 REPLIES 8
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

Start by talking to your admin.  only they know for sure because your server is your server not the worlds server.

SASSLICK001
Obsidian | Level 7

Sorry I was not clear, I meant to say to get the location of the sas program automatically programmatically

Tom
Super User Tom
Super User

@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.

SASSLICK001
Obsidian | Level 7
I mean saved program in the unix directory
ex: /opt/level1/level2/level3/level4
heffo
Pyrite | Level 9

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.

 

 

SASSLICK001
Obsidian | Level 7
I run the program from display manager or Enterprise guide. when the program executes it should get the location of the program where it resides automatically
Kurt_Bremser
Super User

Enterprise Guide provides the filename of the loaded program in macro variable _sasprogramfile.

Display Manager does not provide a mechanism for this.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 8 replies
  • 729 views
  • 0 likes
  • 5 in conversation