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

BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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