BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
bkmant
Calcite | Level 5

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

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

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;

 

View solution in original post

10 REPLIES 10
Kurt_Bremser
Super User

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.

bkmant
Calcite | Level 5
Many thanks for getting back. I confirm the program has been saved into the folder present on the server. The program i.e. starting.sas contains the macro starting. I can open and run the starting program to compile the macro but really want to have some way to call macros so I don';t have to embed them within my programs. I am using basic version of studio 3.6: SAS platform: Linux LIN X64 2.6.32-754.28.1.el6.x86_64 Thanks again for your help.
Cynthia_sas
SAS Super FREQ
Hi: But are you using SAS Studio on your own company or school network or are you using SAS Studio via SAS University Edition in a Virtual Machine or SAS OnDemand for Academics?

My understanding of SASAUTOS is that it is expecting a LIBRARY name, NOT a folder path. In your example, it looks like you have a folder path. If you have multiple libraries, you separate them with a comma. So I suspect that you are pointing to the wrong location in the option. Here's the doc site: https://go.documentation.sas.com/?docsetId=mcrolref&docsetTarget=p12b2qq72dkxpsn1e19y57emerr6.htm&do...

Hope this helps,
Cynthia
bkmant
Calcite | Level 5
Thanks for looking not my query Cynthia. I confirm I am using studio via my company. My understanding is sasautos can use file references enclosed in quotes. I've also checked the nomencalture of the file path as it's running on a unix platform and can't see a problem there.
Tom
Super User Tom
Super User

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.

bkmant
Calcite | Level 5
Many thanks Tom for looking into this. I just checked SAS version which is: SAS 9.04.01M3P062415 for Linux. Sas studio is running on a unix server which I have access to. I confirm the program and macro call are all in lower case i.e. starting.sas as well as the file path. I have successfully set a libname to the filepath used on sasauto option so not sure why it's not being compiled
Tom
Super User Tom
Super User

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;

 

bkmant
Calcite | Level 5

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

bkmant
Calcite | Level 5
Many thanks I confirm the include option also works for me to run the program so I don't have to embed it in my new program. Thanks for your help and have a great rest of the week

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

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
  • 10 replies
  • 2058 views
  • 1 like
  • 4 in conversation