BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SAS_inquisitive
Lapis Lazuli | Level 10

Hello,

 

I just moved to SAS in Unix.  How are the file paths  (such as in LIBNAME and FILENAME statement) and autocall macros specified in it? Here is one example code I referenced from  one thread in SAS communities. Is  /data/SAS_Projekte/SAS_Makros full path for macro and what is '!SASROOT/sasautos'

 

 

options mautosource mrecall noxwait sasautos=('/data/SAS_Projekte/SAS_Makros','/data/SAS_Projekte/SAS_Makros/Utility_Makros', '!SASROOT/sasautos');

Thanks !

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

SASAUTOS sets a search order of directories to look for your autocall macros. By placing SASAUTOS second in side the parentheses it says to set the !SASROOT/sasautos to be searched before the current description of SASAUTOS. This may be needed if someone had specified a SASAUTOS path that excluded the (usually a default) !SASROOT/sasautos for some reason.

 

the '.' indicates to search the current executing directory and './SAS_macros' says to search a directory to current executing named SAS_macros (if it exists).

View solution in original post

4 REPLIES 4
jklaverstijn
Rhodochrosite | Level 12

Hi @SAS_inquisitive,

 

It is indeed a full path. This is apparent because of the starting forward slash in the path. If that were missing the path would be relative to the current working directory.

 

!SASROOT is a variable that is specified in the SAS config  file (eg. sasv9.cfg) using the -set directive. It is expanded to whatever location SAS is installed into. Usually the directory containing the subdir SASFoundation. The variable refeference with an exclamation point will also expand when inside single quotes, unlike a macro variabel reference.

 

Greetings from the Quad at SGF,

- Jan.

ballardw
Super User

Second one first:

 

!SASROOT refers to a SAS configuration setting that refers to the root location where SAS is installed

 

I recommend using a fully qualified path from where you mount the file system. /data/ is going to start a path relative to where SAS is currently executing which may not be quite where you expect.

SAS_inquisitive
Lapis Lazuli | Level 10

@jklaverstijn @ballardw.  Thank you.

 

Here is the another example code..

 

options mrecall noxwait sasautos=('!SASROOT/sasautos' sasautos '.' '.\SAS_macros');

 

What is the  '.' , '.\SAS_macros', and sasautos in the parenthesis?

 

Thanks !

ballardw
Super User

SASAUTOS sets a search order of directories to look for your autocall macros. By placing SASAUTOS second in side the parentheses it says to set the !SASROOT/sasautos to be searched before the current description of SASAUTOS. This may be needed if someone had specified a SASAUTOS path that excluded the (usually a default) !SASROOT/sasautos for some reason.

 

the '.' indicates to search the current executing directory and './SAS_macros' says to search a directory to current executing named SAS_macros (if it exists).

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 4 replies
  • 1367 views
  • 3 likes
  • 3 in conversation