I just noticed something utterly... [well I shouldn't get nasty] in
the IEFZB902 macro.
It defines a cblock map. It doesn't particularly matter which one...
But here's a code snippet:
DSNQTABL EQU *
DSNQSVA DS CL3 SVA OF THIS RECORD Y02668
DSNQID DS CL1 DSENQ ID X'0F' Y02668
DSNQTID EQU X'0F' INITIALIZE TABLE ID FIELD Y02668
DSNQNSVA DS CL3 SVA OF NEXT DSENQ RECORD Y02668
DSNQRS01 DS CL1 RESERVED Y02668
DSNQNEXT DS CL4 IN-CORE ADDRESS OF NEXT RECORDY02668
DSNQFREE DS CL2 NO. OF FREE BYTES IN RECORD Y02668
DSNQNTRY EQU * DSNAME ENTRY Y02668
DSNQDSNP DS 0CL3 DSNAME PREFIX AREA @L1A
DSNQSTEP DS CL1 NO. STEP LAST REFERENCED Y02668
DSNQFLG1 DS CL1 FLAGS Y02668
DSNQSHR EQU 128 SHARED Y02668
DSNQDSNL DS CL1 LENGTH OF DSNAME Y02668
DSNQDSN EQU * DSNAME Y02668
DSNQLEN EQU DSNQTABL+176 Y02668
The macro does not emit a dsect statement, but that's not the issue...
DSNQTABL is the map's first field, and DSNQLEN is (apparently)
intended to represent the length of the cblock.
DSNQLEN incorporates a magic number into its definition, but that's
not the issue either.
What *is* the issue is that DSNQLEN is relocatable! So it actually is
not a length at all! Instead, it is a location! It is the location of
the end of the cblock.
This, of course, leads to syntax errors when you attempt to use the
field name as a length.
This bollix has been in the macro probably for decades, so of course
trying to "fix" it would cause far more trouble than it's worth. But
it *would* be nice if IBM would add some commentary to the field
definition warning unwary users (such as myself) away from
misunderstanding what DSNQLEN actually is.
A lesser issue is that there is no DS defined that moves the dsect's
location counter to the end of intended fields. So if someone
embedded the macro into another dsect (easily done since the macro
does not emit its own dsect statement), it is likely this would lead
to data following the DSNQ cblock being overlaid by a dsname. (So
maybe this isn't the lesser issue after all?)
This issue (unlike the prior issue) could be easily fixed without
negatively impacting anyone.
Ok, I'll shut up now.
Dave Cole
ColeSoft Marketing
414 Third Street, NE
Charlottesville, VA 22902
EADDRESS: [email protected]
Home page: www.colesoft.com
Facebook: www.facebook.com/colesoftware
YouTube: www.youtube.com/user/colesoftware