SAS EG doesn't recognize autocall library

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 11
Accepted Solution

SAS EG doesn't recognize autocall library

Dear Community:

I want to submit the following lines in SAS EG but SAS keeps giving me a WARNING that RANDNUM not resolved.

The code runs fine when I submit in batch on the UNIX machine.  I did run a proc options and SASAUTOS=("/export/home/ga") and MAUTOSOURCE is on.

BTW. I am also having a hard time with SAS EG recognizing a user defined function library.

Julie

********************** Lines of Code ******************************************************

options mautosource sasautos=("/export/home/ga");

run;

* test the macro library;

%randNum(666);

********************* SAS EG Log ******************************************************

1                                The SAS System  12:07 Wednesday, April 15, 2015

1          %_eg_hidenotesandsource;

6          %_eg_hidenotesandsource;

20       

21         options mautosource sasautos=("/export/home/ga");

WARNING: Apparent invocation of macro RANDNUM not resolved.

22         run;

23       

24         * test the macro library;

25         %randNum(666);

             _

           180

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

26       

27       

28         %_eg_hidenotesandsource;

40       

41       

42         %_eg_hidenotesandsource;

45

************************ SAS Log from Batch Submit *********************************************

1          options mautosource sasautos=("/export/home/ga");

2          run;

3        

4          * test the macro library;

5          %randNum(666);

MACROGEN(RANDNUM):   data _null_;

MACROGEN(RANDNUM):   call symput("_rand",ranuni(666));

MACROGEN(RANDNUM):   run;

NOTE: Numeric values have been converted to character

           values at the places given by: (Line)Smiley SadColumn).

           5:41 

NOTE: DATA statement used (Total process time):

      real time           0.02 seconds

      cpu time            0.01 seconds

Your seed 666 generated 0.1850715015 as your random number

6        


Accepted Solutions
Solution
‎04-15-2015 08:17 PM
PROC Star
Posts: 402

Re: SAS EG doesn't recognize autocall library

As you are on a UNIX server platform, I'm wondering if you are running into an autocall macro file name case sensitivity issue. I notice that you are using mixed-case (randNum) when you call the macro. What case have you used for the autocall macro file name: randnum.sas or randNum.sas.

If you have a look at the Using Autocall Libraries in UNIX Environments page in the SAS 9.4 Companion for UNIX Environments, and in particular the section Guidelines for Naming Macro Files, it recommends the following:

Macro names in SAS are case insensitive, but they all map to a lowercase filename. If you store autocall macros in a UNIX directory, the file extension must be .sas, and the filename must be entirely in lowercase. In the UNIX environment, each macro file in the directory must contain a macro definition with a macro name that matches the filename. For example, a file named prtdata.sas should define a macro named prtdata.

I'm wondering if you have a mixed-case filename randNum.sas when it needs to be lower-case randnum.sas ?

View solution in original post


All Replies
PROC Star
Posts: 1,287

Re: SAS EG doesn't recognize autocall library

Hi,

Are you batch submitting on the same unix server that EG is connecting to?  When you batch submit are you logged in with the same OS account as EG is using?

One check is to make sure you can see the files from EG (i.e. make sure you have read access).  If you have XCMD enabled, you could try:

filename x pipe "ls  /export/home/ga" ;
data _null_ ;
  infile x ;
  input ;
  put _infile_ ;
run ;

To see if you can see the .sas files.

PROC Star
Posts: 1,287

Re: SAS EG doesn't recognize autocall library

Also try adding OPTION MRECALL;


That tells SAS to look for an autocall macro definition every time you try to invoke a macro.  Useful for debugging autocall when you might have called it once without having the library set up.

Solution
‎04-15-2015 08:17 PM
PROC Star
Posts: 402

Re: SAS EG doesn't recognize autocall library

As you are on a UNIX server platform, I'm wondering if you are running into an autocall macro file name case sensitivity issue. I notice that you are using mixed-case (randNum) when you call the macro. What case have you used for the autocall macro file name: randnum.sas or randNum.sas.

If you have a look at the Using Autocall Libraries in UNIX Environments page in the SAS 9.4 Companion for UNIX Environments, and in particular the section Guidelines for Naming Macro Files, it recommends the following:

Macro names in SAS are case insensitive, but they all map to a lowercase filename. If you store autocall macros in a UNIX directory, the file extension must be .sas, and the filename must be entirely in lowercase. In the UNIX environment, each macro file in the directory must contain a macro definition with a macro name that matches the filename. For example, a file named prtdata.sas should define a macro named prtdata.

I'm wondering if you have a mixed-case filename randNum.sas when it needs to be lower-case randnum.sas ?

Occasional Contributor
Posts: 11

Re: SAS EG doesn't recognize autocall library

Thank you.  I didn't think about cases sensitivity because the code worked when I submitted it batch.

Julie

PROC Star
Posts: 1,287

Re: SAS EG doesn't recognize autocall library

Glad you got it working, but I'm surprised.  You said it worked when you submitted it in batch on unix, right?  That means the file names must be lower case there.  So if your EG session is using the same auto call directory as your batch job, the file names should still be lower case there...  Or did it turn out that your EG session was using a different auto call library than your batch submit job? 

Occasional Contributor
Posts: 11

Re: SAS EG doesn't recognize autocall library

I just tested this again.  It is not working under UNIX batch. I must have confused my runs.

BTW. I marked your answer above correct but it is not showing up that way.  Additionally - I marked your other replies as helpfult but for some reason it is not working.

PROC Star
Posts: 1,287

Re: SAS EG doesn't recognize autocall library

Okay, that makes sense.  I see Paul's answer as correct, mine as helpful, which seems good to me.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 979 views
  • 7 likes
  • 3 in conversation