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 !
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).
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.
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.
@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 !
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).
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.