DATA Step, Macro, Functions and more

SAS SERVER PATH ACCES UNDER UNIX

Reply
Super Contributor
Posts: 371

SAS SERVER PATH ACCES UNDER UNIX

[ Edited ]

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) 

Super User
Posts: 6,955

Re: SAS SERVER PATH ACCES UNDER UNIX

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 9,685

Re: SAS SERVER PATH ACCES UNDER UNIX

Not sure if the following could work.


libname lib ".";

%put %sysfunc(pathname(lib));

Respected Advisor
Posts: 3,899

Re: SAS SERVER PATH ACCES UNDER UNIX

[ Edited ]

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;
Super User
Posts: 6,955

Re: SAS SERVER PATH ACCES UNDER UNIX

If you just want to get the physical path for a defined library, use the pathname() function.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super Contributor
Posts: 371

Re: SAS SERVER PATH ACCES UNDER UNIX

[ Edited ]

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

Super User
Posts: 6,955

Re: SAS SERVER PATH ACCES UNDER UNIX

What do you mean by "identify"?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Respected Advisor
Posts: 3,899

Re: SAS SERVER PATH ACCES UNDER UNIX

[ Edited ]

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

 

 

Ask a Question
Discussion stats
  • 7 replies
  • 209 views
  • 1 like
  • 4 in conversation