01-03-2017 05:52 PM - edited 01-03-2017 05:53 PM
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 ...
libname lib "/app/server1/files/project01";
Please, how can I identify this path ( /app/server1, some can be $home or not)
01-03-2017 06:14 PM
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.
01-03-2017 11:30 PM - edited 01-03-2017 11:31 PM
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;
01-04-2017 06:07 AM
If you just want to get the physical path for a defined library, use the pathname() function.
01-04-2017 04:52 PM - edited 01-04-2017 04:54 PM
@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 ?
01-04-2017 06:12 PM
What do you mean by "identify"?
01-04-2017 10:23 PM - edited 01-04-2017 10:25 PM
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?
And you would want to know the path to "Files" as set in SMC?
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.