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!
Without wanting to overwrite the SASAUTOS library, Ron Cody's solution works like a charm:
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;
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/ .
This works for me on SAS On Demand:
%macro test;
%put Test worked!;
%mend;
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.
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.
Ready to level-up your skills? Choose your own adventure.