I have a macro that is giving strange results, so I must be doing something wrong.

The macro is used so that I can easily port z/VSE and z/OS code between the two operating systems. It was working until I needed to handle operands that are null.

         MACRO
&NAME    Z@DCB &RECFM=,&LRECL=,&BLKSIZE=,&EODAD=,                 BOTH X
               &DDNAME=,&MACRF=,&DSORG=,                          Z/OS X
               &DTF=,&DEVADDR=,&IOAREA1=0,                        VSE  X
               &XXX=                                              JUNK
....
.DCBZOS  ANOP
&DDNX    SETC 'DDNAME=&DDNAME.'
&RECX    SETC ',RECFM=&RECFM.'
&DSOX    SETC ',DSORG=&DSORG.'
&LREX    SETC ',LRECL=&LRECL.'
&BLKX    SETC ',BLKSIZE=&BLKSIZE.'
&EODX    SETC ',EODAD=&EODAD.'
&MACX    SETC ',MACRF=&MACRF.'
         AIF ('&RECFM' NE '').RFM
&RECX    SETC ''
.RFM     ANOP
         AIF ('&DSORG' NE '').DORG
&DSOX    SETC ''
.DORG    ANOP
         AIF ('&LRECL' NE '').LREC
&LREX    SETC ''
.LREC    ANOP
         AIF ('&BLKSIZE' NE '').BLKS
&BLKX    SETC ''
.BLKS    ANOP
         AIF ('&EODAD' NE '').EOD
&EODX    SETC ''
.EOD     ANOP
         AIF ('&MACRF' NE '').MAC
&MACX    SETC ''
.MAC     ANOP
&PARMS  SETC '&DDNX.&DSOX.&LREX.&BLKX.&EODX.&MACX.&RECX'

&NAME   ZDCB   &PARMS
&NAME    DCB   &PARMS


The two identical lines with ZDCB and DCB are just so that the first one prints (with an error) before the second one attempts to work.

My first example is really stripped down:
SYS020   Z@DCB MACRF=E,DDNAME=SYS020,DTF=NO

The assembly reports:

1202+***************************************
1203+SYS020 ZDCB DDNAME=SYS020,MACRF=E
** ASMA057E Undefined operation code - Z@DCB/ZDCB
** ASMA435I Record 120 in SYS1.PROZ.COPYLIB(Z@DCB) on volume: RESCUG
** ASMA254I *** MNOTE ***          1207+     12,***  IHB052  DSORG OMITTED
** ASMA254I *** MNOTE *** 1209+ 12,*** IHB066 INCONSISTENT OPERANDA 00081C 1210+SYS020 DS 0F GENERATED TO DEFINE NAME

Yet, just for testing, I also coded a basic DCB that is identical to waht the macro is generating, and it works.

1212 SYS020 DCB DDNAME=SYS020,MACRF=E 1215+* DATA CONTROL BL
                                   1216+*
00081C 1217+SYS020 DS 0F'0' ORIGIN ON
** ASMA043E Previously defined symbol - SYS020
no other errors on the usage of DCB.

I assume that I must be hitting some quirk in how macros work when generating parms for another macro.


Tony Thigpen

Reply via email to