So far I have used %include statements for my macros, so I wanted to experiment with Autocall libraries since this seems to be better.
I have read the documentation but I still cannot figure out how to do it...
What I have done:
filename MacLib "MyDir"; /* Directory containing the macros */
options mautosource sasautos=MacLib;
When trying to run my macro (lets say it is called MyMacro) it does not work? The log says:
WARNING: Apparent invocation of macro MyMacro not resolved.
Why? Specific examples on how to set up autocall libraries would be appreciated.
The macro %mymacro has to be saved in a file called "mymacro.sas" in "MyDir". The file must contain one and only one macro definition for mymacro.
You also need to avoid removing the original SASAUTOS library (see here), so your OPTIONS statement should be
options mautosource sasautos=(sasautos,MacLib);
I suggest a different solution than @Kurt_Bremser , although if no one in your department is currently using an AUTOCALL library, it doesn't really matter.
Use the command
options append=(sasautos=MacLib);
For people using other AUTOCALL Libraries, the command given by Kurt Bremser disables the other AUTOCALL libraries that the people are using. The command above does not, it leaves those other AUTOCALL libraries available and adds the macros in MacLib into that person's AUTOCALL library, and this works fine for people in both categories (using AUTOCALL libraries and not using AUTOCALL libraries).
If at some time in the future, someone else wants to create their own AUTOCALL library, this approach works better.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.