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) ) ;

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!

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
  • 4 replies
  • 2446 views
  • 0 likes
  • 5 in conversation