You can view, through debug, all the different occurrences of a multiple occurrence data structure (in addition to the occurrence that is currently set by the program), if you have the Object Definition Table (ODT) number of the multiple occurrence data structure in question. There are two ways to get the ODT number of the data structure:
o Compile the program with the generation options parameter specified with *LIST and *XREF to get an Intermediate Representation Program (IRP) listing and a cross reference of the IRP. For example:
CRTRPGPGM PGM(pgmlib/pgm) + SRCFILE(srclib/srcfile) + GENOPT(*LIST *XREF)
Within the IRP cross-reference section (which will be toward the end of the spool file) under the column titled "ODT Name," find the entry for the multiple occurrence data structure that you wish to view. It will be followed by another entry with the same name but with a suffix of zero. Appearing in front of this entry is a four-character hexadecimal number-this is the ODT number.
o Dump the program object to a spool file using the DMPOBJ command as shown:
DMPOBJ OBJ(library/program) + OBJTYPE(*PGM)
Scan the listing for the name of the multiple occurrence data structure using the scan function. Prior to the name of the data structure will be the definition of a field of the same name with a suffix of zero. Look in the hexadecimal portion of the listing on the same line to find the hexadecimal representation of this field, and find the eight characters that immediately precede the field-the first four characters in the group of eight are the ODT number.
Once you have the ODT number, you can view all the occurrences of the multiple occurrence data structure by entering a slash followed by the ODT number on an Add Breakpoint (ADDBKP) or Display Program Variable (DSPPGMVAR) statement. For example:
ADDBKP STMT(12500) + PGMVAR('/0098')
Or:
DSPPGMVAR PGMVAR('/0098')
LATEST COMMENTS
MC Press Online