BookmarkSubscribeRSS Feed
RMan
Calcite | Level 5
I'm running batch programs in SAS v 9.1.3 on a z/OS mainframe.

Our SAS system has recently stopped recognizing AUTOCALL macros that are installed with the system, such as TRIM and DS2CSV. The problem may have started when we upgraded to the current version and got a new JCL proc. I located the dataset where all the system macros are stored, and this dataset is referenced in the PROC's SASAUTOS DD statement, but SAS apparently isn't searching it.

SAS does find macros that I wrote and stored in a separate dataset. But one of those macros calls TRIM, which throws the following error message:

Autocall member, TRIM, has not been compiled by the macro processor. It may contain a macro syntax error or not define a macro with the same name as the member. To autocall this member again, set OPTION MRECALL.

I also tried calling DS2CSV and got a similar message. I don't know where to start troubleshooting this. (I can add code samples to this post if someone will suggest what would be helpful to see.)
12 REPLIES 12
SASKiwi
PROC Star
Have a look at your SASAUTOS SAS option. To keep both your own AUTOCALL macros plus the SAS ones you could try something like this:

options SASAUTOS=(MYAUTOS, SASAUTOS);

The MYAUTOS DD points to your AUTOCALL macros and this is concatenated in front of the SAS SASAUTOS so you should be able to use both.
RMan
Calcite | Level 5
I tried that method, SASKiwi, but SAS still only recognizes the macros in my library, but not those in the system library.

I also tried adding a separate libref (DD statement in JCL) pointing to the system library, but that also failed with a JCL error, apparently because the production JCL procedure has already mapped to that same library.

I may have to give in and take this to our mainframe SAS administrator, although he isn't a SAS programme per se.

Thank you for the reply.
ballardw
Super User
MAUTOSOURCE option set?
RMan
Calcite | Level 5
Yes, the program has OPTIONS MAUTOSOURCE;

At the risk of going overboard, I'm pasting below the JCL and the SAS log, minus some irrelevant steps.

JCL:
Note where the system proc points to the system autocall library AUTOLIB, and the line where I point to my macro library, both highlighted.

1 //GJDC1PME JOB (T-6288-00,C451),'CARPENTER',
// CLASS=T,
// NOTIFY=GJDC1,
// MSGCLASS=Q,
// TYPRUN=HOLD,
// MSGLEVEL=(1,0)
2 //PDEF OUTPUT PAGEDEF=06080,CHARS=GT15
3 //JS10 EXEC PROC=SASPRD,WORK='100,10',SORT=50,COPIES=1
4 XXSASPRD PROC ENTRY=SASB,
XX CONFIG=NULLFILE,
XX LOAD='*.NULLPDS,VOL=REF=*.NULLPDS',
XX SASAUTO='*.NULLPDS,VOL=REF=*.NULLPDS',
XX OPTIONS=,
XX SORT=4,
XX COPIES=1,
XX WORK='5,3'
XX*********************************************************************
XX* PRODUCT: MVS SAS RELEASE 9.1.3 **
XX* SAS PRODUCTION PROC **
XX*********************************************************************
5 XXSAS913 EXEC PGM=&ENTRY,PARM='SORT=&SORT &OPTIONS',REGION=4096K
IEFC653I SUBSTITUTION JCL - PGM=SASB,PARM='SORT=50 ',REGION=4096K
6 XXNULLPDS DD DISP=(MOD,PASS),DSN=&&NULLPDS,UNIT=DISKW,
XX SPACE=(TRK,(1,1,1)),DCB=BLKSIZE=6160
7 XXSTEPLIB DD DISP=(SHR,PASS),DSN=&LOAD
IEFC653I SUBSTITUTION JCL - DISP=(SHR,PASS),DSN=*.NULLPDS,VOL=REF=*.NULLPDS
8 XX DD DISP=SHR,DSN=SYS3.SAS.GEN.LIBRARY
XX** UNCOMMENT/SUPPLY YOUR DSN IF YOU NEED TO CONCATENATE SORT LIB
XX** DD DISP=SHR,DSN=SYS1.SORT.LINKLIB
9 XXSASEXEC DD DISP=SHR,DSN=&CONFIG
IEFC653I SUBSTITUTION JCL - DISP=SHR,DSN=NULLFILE
10 XXCONFIG DD DISP=SHR,DSN=SYS3.SAS.GEN.CNTL(BAT1920)
11 XXSASAUTOS DD DISP=(SHR,PASS),DSN=&SASAUTO
IEFC653I SUBSTITUTION JCL - DISP=(SHR,PASS),DSN=*.NULLPDS,VOL=REF=*.NULLPDS
12 XX DD DISP=SHR,DSN=SYS3.SAS.GEN.AUTOLIB

13 XXSASHELP DD DISP=SHR,DSN=SYS3.SAS.GEN.SASHELP
14 XXSASMSG DD DISP=SHR,DSN=SYS3.SAS.GEN.SASMSG
15 XXZIP DD DSN=SYS3.SAS.COUNTIES,DISP=SHR
16 XXWORK DD UNIT=DISKW,SPACE=(CYL,(&WORK),,,ROUND),
XX DCB=(RECFM=FS,LRECL=6144,BLKSIZE=6144,DSORG=PS)
IEFC653I SUBSTITUTION JCL - UNIT=DISKW,SPACE=(CYL,(100,10),,,ROUND),DCB=(RECF
DSORG=PS)
17 XXSASLOG DD SYSOUT=*
18 //SASLIST DD SYSOUT=*,OUTPUT=*.PDEF
X/SASLIST DD SYSOUT=*
19 XXSASPARM DD UNIT=DISKW,SPACE=(400,(100,300)),
XX DCB=(RECFM=FB,LRECL=80,BLKSIZE=400,BUFNO=1)
20 XXSYSUDUMP DD SYSOUT=*
21 XXSAS3287 DD SYSOUT=(N,SASWTR),COPIES=&COPIES
XX** ADD A LINE LIKE THE FOLLOWING TO CREATE A MACHINE-READABLE DUMP
XX*SYSMDUMP DD DSN=DUMP,UNIT=SYSDA,DISP=(NEW,CATLG),SPACE=(TRK,(20,5))
//*** SAS DATA LIBRAR(IES)
IEFC653I SUBSTITUTION JCL - SYSOUT=(N,SASWTR),COPIES=1
22 //SASUSER DD DSN=GJDC1.SAS,DISP=OLD
23 //SASLIB DD DUMMY SAS FORMAT
//*** LOCATION OF MACRO LIBRAR(IES)
24 //MYMACRO DD DSN=TEST.USRA.OMIS.SASMACRO,DISP=SHR
//*ASAUTOS DD DSN=SYS3.SAS.GEN.AUTOLIB,DISP=SHR
//*** POLICY MASTER EXTRACT FILE(S)
//*OLEXTR DD DSN=USR.UIC.EMACCVPM(0),DISP=SHR CURRENT MONTHLY
//* DD DSN=USR.UIC.EMCPCVPM(0),DISP=SHR CURRENT PURGE YTD
//* DD DSN=USR.UIC.EATPCVPM(0),DISP=SHR TOTAL PURGE
//*OLEXTR DD DSN=CLA.APM.AWCOVPME(0),DISP=SHR CURRENT WEEKLY
25 //POLEXTR DD DSN=GJDC1.PMCREAT(-0),DISP=SHR INPUT MAIN FILE
26 //DATADLM DD DSN=GJDC1.DATA.TXT(+1), OUTPUT TEXT FILE
// UNIT=DISKT,SPACE=(TRK,(500,100),RLSE),
// DISP=(NEW,CATLG,CATLG),
// DCB=(LRECL=600,BLKSIZE=,RECFM=FB)
//*OLEXTR DD DUMMY
27 //SYSIN DD *


SAS log:
Note that the macro on line 28 works properly. Later, my macro CSV1 calls system macro TRIM, which fails.


NOTE: The initialization phase used 0.11 CPU seconds and 12694K.
NOTE: The address space has used a maximum of 656K below the line and 13728K abo
NOTE: AUTOEXEC processing beginning; file is NULLFILE.
NOTE: AUTOEXEC processing completed.

1 *--------------------------------------------------------------------
...skipping comments...
15 OPTION VALIDVARNAME=V7; /* ENABLE LONG VARIABLE NAMES */
16 OPTIONS ERRORS=2;
17 *PTIONS OBS=10; /* LIMIT NUMBER OF INPUT ROWS TO READ */
18 OPTIONS MAUTOSOURCE; /* ENABLE THE USE OF MACROS IN SASAUTOS */
19 OPTIONS NOMPRINT; /* PRINT MACRO STATEMENTS */
20 OPTIONS SASAUTOS=(MYMACRO,SASAUTOS);
21 OPTION MRECALL;
22
23
24 DATA WORK.TXFER;
25
26 * FOLLOWING MACRO READS THE POLICY MASTER EXTRACT INTO A SAS DATA SET
27 OPTIONS NOMPRINT;
28 %PMEV2;
29
30 *IF SUBSTR(POLICYNO,10,1) = '5';
31 *IF PREM_EFF_DATE GE '01MAR2009'D AND
32 PREM_EFF_DATE LE '30APR2010'D;
33 *IF GAAP_CODE NE '30'-'39';
34 *IF BILL_STAT LE '40';
35 *IF COV_EFF_DATE GE '01JAN2006'D;
36

NOTE: The infile POLEXTR is:
Dsname=GJDC1.PMCREAT.G0102V00,
Unit=3390,Volume=TSO920,Disp=SHR,Blksize=27600,
Lrecl=600,Recfm=FB

NOTE: 45 records were read from the infile POLEXTR.
NOTE: The data set WORK.TXFER has 45 observations and 101 variables.
NOTE: The DATA statement used 0.16 CPU seconds and 14872K.

...skipping additional data steps and procs...

81 %CSV1(DATASET=WORK.POLCSV, /* DATASET TO WRITE
82 FILENAME=DATADLM, /* DDNAME OF THE FILE TO WRITE
83 DLMR="05"X, /* DELIMITER BETWEEN VALUES
84 QTES="YES", /* QUOTE ALL CHARACTER VARIABLES?
85 HEADER="YES", /* HEADER LINE WITH COLUMN NAMES?
86 LABEL="YES"); /* USE LABELS INSTEAD OF VAR NAMES?

NOTE: The PROCEDURE CONTENTS printed pages 1-2.
NOTE: The PROCEDURE CONTENTS used 0.06 CPU seconds and 15710K.

NOTE: The address space has used a maximum of 656K below the line and 16780K abo



NOTE: The data set WORK.___OUT_ has 32 observations and 40 variables.
NOTE: The PROCEDURE CONTENTS used 0.02 CPU seconds and 15710K.

NOTE: The address space has used a maximum of 656K below the line and 16780K abo

4 The SAS Syst

NOTE: The PROCEDURE CONTENTS printed pages 3-4.


NOTE: There were 32 observations read from the data set WORK.___OUT_.
NOTE: The data set WORK.___OUT_ has 32 observations and 40 variables.
NOTE: The PROCEDURE SORT used 0.00 CPU seconds and 15710K.

NOTE: The address space has used a maximum of 656K below the line and 16780K abo



NOTE: Numeric values have been converted to character values at the places given
86:245
NOTE: There were 32 observations read from the data set WORK.___OUT_.
NOTE: The DATA statement used 0.01 CPU seconds and 15739K.

NOTE: The address space has used a maximum of 656K below the line and 16816K abo


NOTE: Autocall member, TRIM, has not been compiled by the macro processor. It ma
name as the member. To autocall this member again, set OPTION MRECALL.
WARNING: The quoted string currently being processed has become more than 262 ch
ERROR: A character operand was found in the %EVAL function or %IF condition wher
ERROR: A character operand was found in the %EVAL function or %IF condition wher
ERROR: A character operand was found in the %EVAL function or %IF condition wher
ERROR: The %TO value of the %DO I loop is invalid.
ERROR: The %TO value of the %DO I loop is invalid.
ERROR: The %TO value of the %DO I loop is invalid.
ERROR: The macro CSV1 will stop executing.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
And you are positive that the library SYS3.SAS.GEN.AUTOLIB is not corrupted in any way? Have you attempted to copy that library using IEBCOPY (or ISPF 3.3), and then substitute the copied PDS library version in-place of the SAS software library mentioned above.

Also, you should be able to add a DD to your JCL member with

//AUTOS DD DISP=SHR,DSN=SYS3.SAS.GEN.AUTOLIB

and then do a %INCLUDE AUTOS(TRIM); to see how SAS reacts.

And, so, I believe your situation warrants contacting SAS Tech Support once you have confirmed that the SAS-system AUTOLIB PDS library is not corrupted.

Scott Barry
SBBWorks, Inc.
RMan
Calcite | Level 5
Thank you for the suggestions, Scott. I successfully INCLUDEd the TRIM macro both with the system libref and by defining a new one. I also copied TRIM and DS2CSV into a new library, but still get the same error trying to call them.

Funny though, even when INCLUDE reads the TRIM macro into the program, it still isn't recognized when TRIM is called.

Looks like I'll have to refer this to Tech Support.
SPR
Quartz | Level 8 SPR
Quartz | Level 8
Hello RMan,

There is a macro function %TRIM. May be your problems result from this confusion?

Sincerely,
SPR
ballardw
Super User
> Hello RMan,
>
> There is a macro function %TRIM. May be your problems
> result from this confusion?
>
> Sincerely,
> SPR

That wouldn't be it. Most of the system macro "functions" hang out, in my install, at C:\Program Files\SAS\SASFoundation\9.2\core\sasmacro or similar.
RMan
Calcite | Level 5
Hi, SPR - I think the confusion is simply that I neglected to type the % in my post above. I actually did use the %TRIM function.

Sorry for the confusion!
Peter_C
Rhodochrosite | Level 12
Rman
Are the two autocall macro libraries both FB or both VB pds ?
Sometimes difficulties arise on your platform when RECFM are mixed.
hth
peterC
Ksharp
Super User
Rman
Maybe you site did not setup the autocall macro library.
It looks like the best way is to talk to Technical Support to understand whether your site has this library.

Ksharp
RMan
Calcite | Level 5
I'm going to have our support people open a ticket on the issue. Thanks for the ideas, everyone.

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!

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
  • 12 replies
  • 2760 views
  • 0 likes
  • 7 in conversation