BookmarkSubscribeRSS Feed
LineMoon
Lapis Lazuli | Level 10

Hello experts,

with sas under unix, the administrator define a server path acces, -it can be called $home time or other - it will be used for the allocation of library ...

example  /app/server1

libname lib "/app/server1/files/project01";

Please, how can I identify this path ( /app/server1, some can be $home or not) 

7 REPLIES 7
Kurt_Bremser
Super User

You already have the path, what do you need to identify?

 

The UNIX environment variable $HOME (note the capitalization) contains the absolute path to the user's home directory.

Ksharp
Super User
Not sure if the following could work.


libname lib ".";

%put %sysfunc(pathname(lib));

Patrick
Opal | Level 21

I don't really understand what you're asking for. Assuming you want to list all the UNIX/Linux environment variable which exist during as SAS session then the following code should do (not tested).

filename ll pipe 'env';
data _null_;
  infile ll;
  input;
  put _infile_;
run;
filename ll clear;
LineMoon
Lapis Lazuli | Level 10

@ll: Thank you all for answer.

No, I do not know that path which will be before every directory for allocating a sas unix library.

In my question, I give "/app/server1" as example. In first, I do not know why this special Path in sas unix ? and how can we identify it ?

Patrick
Opal | Level 21

@LineMoon

You really need to explain better what you have and what you're after. Is this directory you're talking about the folder "Files" you see in the Server tree in EG or SAS Studio?

Capture.PNG

 

And you would want to know the path to "Files" as set in SMC?

Capture.PNG

 

This root path should never change once defined for a server so easiest would be to get the information from your SAS Admin.

 

So far I couldn't find an automatic macro variable or the like containing this root path and I want to avoid proposing to query SAS Metadata directly. May be ask your SAS Admin to define such a macro variable in the Server Context autoexec which contains this root path so you can use it programmatically.

 

Another way: Go to a sub-folder and add a SAS table to your project. Then look at this SAS table's properties. That will give you the path.

 

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 7 replies
  • 2075 views
  • 1 like
  • 4 in conversation