BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
derekmor54
Obsidian | Level 7

Hi all,

 

Is there a way to set up an autocall library for macros? I've used:

OPTIONS MAUTOSOURCE SASAUTOS=('/home/me/rrdb/data'  '/home/me/rrdb/autocall' SASAUTOS);

It worked under University edition, but ODA doesn't seem to recognize the autocall directory.

 

Thanks in advance!

 

1 ACCEPTED SOLUTION

Accepted Solutions
derekmor54
Obsidian | Level 7

Without wanting to overwrite the SASAUTOS library, Ron Cody's solution works like a charm:

 

AutoCall6.jpg

 

View solution in original post

4 REPLIES 4
Patrick
Opal | Level 21

Do these directories actually exists and if yes does your user have at least read access? Can you run below code without error?

libname test '/home/me/rrdb/data';
data test.class;
  set sashelp.class;
run;
proc delete data=test.class;
run;quit;
libname test clear;
Quentin
Super User

Are you able to  %include a macro definition, e.g.:

%include /home/me/rrdb/autocall/mymacro.sas ;

?

 

Assuming you're on linux, are the names of your .sas files all lower case?  (Linux SAS won't find autocall macros where the file name has upper case letters).  

 

Did you try testing the code in a fresh session?  The default SAS session has option NOMRECALL set, so if it looks for an autocall macro once and can't find it, it will never look again (even if you've updated the autocall path).  You might want to set options MRECALL while debugging the autocall library.

 

In this blog posts, Ron Cody shows one way to set up the an autocall library for SODA: https://blogs.sas.com/content/sgf/2022/01/27/sas-auto-call-facility/ .

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
derekmor54
Obsidian | Level 7

Without wanting to overwrite the SASAUTOS library, Ron Cody's solution works like a charm:

 

AutoCall6.jpg

 

Kurt_Bremser
Super User

This works for me on SAS On Demand:

  • create a directory called sasautos in my Home directory
  • store this code there under the name test.sas (all lowercase!)
    %macro test;
    %put Test worked!;
    %mend;
  • then run this program:
    options mautosource sasautos=("~/sasautos" SASAUTOS);
    
    %test
    resulting in this log:
     68         
     69         options mautosource sasautos=("~/sasautos");
     70         
     71         %test
     Test worked!
    

The ~ shortcut will work on all current UNIX systems. It points to the same location as the $HOME environment variable.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 4 replies
  • 1179 views
  • 2 likes
  • 4 in conversation