BookmarkSubscribeRSS Feed
Billybob73
Quartz | Level 8

Hi,

My impression was that when you a a file with a lot of macros in a particular location you could call these macros with a

options sasautos=(sasautos "<path>"));

In my case this does not work. It says "Apparent invocation of macro <macroname>"  not resolved.

Do I need something extra ? Path is existing (checked).

I'm working in a Windows environment.

Thanks !

Rgds

William

 

4 REPLIES 4
andreas_lds
Jade | Level 19

Please post the log as text.

The sas-session is running on windows, too? Or just the client?

ballardw
Super User

@Billybob73 wrote:

Hi,

My impression was that when you a a file with a lot of macros in a particular location you could call these macros with a

options sasautos=(sasautos "<path>"));

In my case this does not work. It says "Apparent invocation of macro <macroname>"  not resolved.

Do I need something extra ? Path is existing (checked).

I'm working in a Windows environment.

Thanks !

Rgds

William

 


To use the SAS autos the macro definition files have to 1) be in the SASAUTOS search path 2) have exactly one macro in each .SAS program file and 3) the name of the file has to be exactly the same as the name of the macro.

 

So if you have a single SAS program file with multiple macro definitions in it then this does not work.

If your file name is different then the name of the macro: such as filename is mymacro and the name of the macro invoked is %countthis then it will not work.

Shmuel
Garnet | Level 18

You can try:

filename mymacros <path>;
options sasautos = (sasautos mymacros);

each macro should be saved separately in the path as <macro_name>.sas    or

you can gather a group of macros in one <file_name1>.sas and precede your code

with: %include <path>/<file_name1>.sas; - in order to compile the macros. 

Ksharp
Super User
Try append system option:

options append=(sasautos=(abc def) ) ;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 3204 views
  • 0 likes
  • 5 in conversation