HI
Hope you are very well
I have historically always used SAS windows PC to run SAS and added a SASAUTOS option in the autoexcec to set the autocall macros when SAS starts up
However moving to SAS studio I am trying to use a similar options i.e.
options mautosource sasautos='mydir/test';
However when calling the macro contained in the folder e.g.
%starting;
I get : WARNING: Apparent invocation of macro STARTING not resolved
So it does not appear the macro has been compiled. I've double checked file path and macro itself and can't find an issue at all
I don't have access to the config files etc so was hoping the SASAUTOS option would work for me
Many thanks in advance
Ben
I don't think creating a LIBNAME will do any good. Unless you are trying to use complied macro objects stored in a SAS catalog, which I would not recommend as it just adds a lot of complexity for little added value. You can use either a quoted physical name or a fileref in the SASAUTOS option. I recommend using the actual path because if you use a fileref the the fileref is now in use and you cannot clear or redefine the fileref.
Here is an example that uses both:
filename sysmac '/everyone/macros';
options sasautos=('/myproject/macros' SYSMAC SASAUTOS);
You can check the SASAUTOS setting using PROC OPTIONS or the GETOPTION() function.
%put %sysfunc(getoption(sasautos));
You might also want to check the MRECALL option. If it previously failed to find %STARTING and you have NOMRECALL it will not go check for it again.
You can try compiling the macro explicitly. Perhaps there is problem in the code? (I doubt it since you would see an error in that case.) So using your example (and correcting for the missing root node in your example path) you might try this program:
%include '/mydir/test/starting.sas';
%starting;
Did you copy your .sas files to the server, into the path you specified?
If you are using University Edition, you must put your files into the shared folder, and set a path of /folders/myfolders/... in the option.
What version of SAS are you using with your SAS/Studio session? Where is it running.
Note that if you have autocall macros stored as files on your PC that you were using with SAS running on your PC and you are now trying to use them on some other machine then the directory needs to accessible from that machine.
Plus if the new machine is using Unix then names of the files must be in all lowercase. So if you are trying to find a macro named STARTING then it is looking for a file name starting.sas. It will not see the file if it is named using any uppercase letters. So names like STARTING.sas or Starting.sas or starting.SAS that work fine on Windows will be "invisible" when running on Unix.
I don't think creating a LIBNAME will do any good. Unless you are trying to use complied macro objects stored in a SAS catalog, which I would not recommend as it just adds a lot of complexity for little added value. You can use either a quoted physical name or a fileref in the SASAUTOS option. I recommend using the actual path because if you use a fileref the the fileref is now in use and you cannot clear or redefine the fileref.
Here is an example that uses both:
filename sysmac '/everyone/macros';
options sasautos=('/myproject/macros' SYSMAC SASAUTOS);
You can check the SASAUTOS setting using PROC OPTIONS or the GETOPTION() function.
%put %sysfunc(getoption(sasautos));
You might also want to check the MRECALL option. If it previously failed to find %STARTING and you have NOMRECALL it will not go check for it again.
You can try compiling the macro explicitly. Perhaps there is problem in the code? (I doubt it since you would see an error in that case.) So using your example (and correcting for the missing root node in your example path) you might try this program:
%include '/mydir/test/starting.sas';
%starting;
Many thanks Tom
It appears the options mrecall needed to be set in the studio environment to get the code working
Have a great rest of the week and thanks again
Ben
Brute force attack: run
%include "/mypath/starting.sas";
and see if it works.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.