DATA Step, Macro, Functions and more

specifying file path and autocall macros in Unix SAS

Accepted Solution Solved
Reply
Regular Contributor
Posts: 234
Accepted Solution

specifying file path and autocall macros in Unix SAS

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 !


Accepted Solutions
Solution
‎04-20-2016 02:14 PM
Super User
Posts: 10,550

Re: specifying file path and autocall macros in Unix SAS

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


All Replies
Super Contributor
Posts: 408

Re: specifying file path and autocall macros in Unix SAS

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.

Super User
Posts: 10,550

Re: specifying file path and autocall macros in Unix SAS

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.

Regular Contributor
Posts: 234

Re: specifying file path and autocall macros in Unix SAS

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

Solution
‎04-20-2016 02:14 PM
Super User
Posts: 10,550

Re: specifying file path and autocall macros in Unix SAS

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

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 265 views
  • 3 likes
  • 3 in conversation