BookmarkSubscribeRSS Feed
Strange_Attractor
Calcite | Level 5
I'm defining my autocall library as follows:

filename sharemac '/home/sas/permanent/BI Group Shared Code';
OPTIONS DATE NOCENTER OBS=MAX MAUTOSOURCE sasautos = (sasautos sharemac);

There is a valid macro in the directory to which sharemac points named cutback_by_model_score.sas. It's called by the same program having the statements above (which show no errors in the log, BTW). This worked when I was using traditional (display manager) SAS, but when I run this call in EG I get:

562 ! %cutback_by_model_score(OUT.&INPUT_SAS_DS,&SEG_ID,&TOT_SEG_TARG,&TREAT_TARG);
_
180
MPRINT(CUTBACK_MANAGER): * Macro call to cutback_by_model_score code;
WARNING: Apparent invocation of macro CUTBACK_BY_MODEL_SCORE not resolved.
MPRINT(CUTBACK_MANAGER): %cutback_by_model_score(OUT.maillist,002,12300,.);

ERROR 180-322: Statement is not valid or it is used out of proper order.

If I open cutback_by_model_score.sas in EG and run it, the problem vanishes. So it has to be something involved in using autocall under EG. Can anyone help me fix what's wrong?

TIA,
Steve
7 REPLIES 7
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
What OS? Is there any other "working" SAS macro defined in the same directory/folder? If so, compare how the complete files are named. If not Windows, may want to verify the file extension, I believe.

Scott Barry
SBBWorks, Inc.
Strange_Attractor
Calcite | Level 5
Thanks for the suggestions.

The SAS server and the file system are in Linux. The .sas extension is correct on all of the macros in the directory (dozens). There are a few name styles (capitalized, mixed, or lower case, single words vs. multiple separated by underscores, etc.), but they all behave the same way.

If I do an %include with the fully specified file name, they're fine, or if I open the code using EG and submit them first, the macro can be used in the same session. None, however, can be found using the autocall facility.

Steve
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Set the max diagnostics you can with:

OPTIONS SOURCE SOURCE2 MACROGEN SYMBOLGEN MLOGIC;

and go from there to diagnose the problem with your macro compilation, possibly.

Scott Barry
SBBWorks, Inc.
Doc_Duke
Rhodochrosite | Level 12
Where are you putting the autocall code? That is, how are you telling EG where to look. EG does not use autoexec.sas, it has it's own startup file (that changed in EG 4.2).
Strange_Attractor
Calcite | Level 5
It's part of the same job where the macro is invoked. Both examples I gave in my initial post are from the same log.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Suggest you add a PROC OPTIONS to detect and print the current SASAUTOS setting at the end of your SAS program in case it has been changed. Some environment issue is causing your problem, in my experience. Or consider using the following statement instead of PROC OPTIONS:

%put %sysfunc(getoption(sasautos));


Scott Barry
SBBWorks, Inc.
Strange_Attractor
Calcite | Level 5
I verified sasautos was correct, then dug up the fexist function to check the filereff. The problem all along was that the directory was named BI Group SAS Code, not BI Group Shared Code. Once sharemac actually points to the real directory, everything works. I'm pretty embarrassed!

Thanks for the help!

Steve

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 7 replies
  • 1673 views
  • 0 likes
  • 3 in conversation