BookmarkSubscribeRSS Feed
SasStatistics
Pyrite | Level 9

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. 

2 REPLIES 2
Kurt_Bremser
Super User

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);
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 587 views
  • 4 likes
  • 3 in conversation