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 (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at 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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 913 views
  • 2 likes
  • 4 in conversation