I assume the easiest way would be to load up an array of field names as you went along, reading each rec of the copybook. When you hit a REDEFINES clause, you'd need to go back thru the array to find the field being redefined, to get its offset byte location. Of course, you'd also have to compute COMP-3, COMP-4, etc.
88 Levels would be easy: They simply take the values from their "parent fields."
Group levels would probably be best done after all the sub-ordinate fields are finished; e.g., for the Level 15 LON-LOAN-SUFX-GRP above, when the next Level <= 15 was found (in this example, the Level 10 field LON-LOAN-STAT), the largest offset byte computed in the previous "group" (byte 21) would also be last offset byte of LON-LOAN-SUFX-GRP.
Is there a "standard" IBM/MVS util to do this? Is the data available as part of a compile option? Maybe someone has long ago written a COBOL pgm to do this, and would be willing to share? Or am I the only one who thinks something like this would be incredibly useful?
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Thu Jul 08, 2004 9:59 am Post subject:
gkreth,
As nutcracker said, option 8 of file-aid does a good job of this. You can also check the "Create DFSORT Symbols from COBOL COPYs" Smart DFSORT Trick which discusses about converting COBOL copybooks to DFSORT symbols, which essentially is the field-names with the start-pos,length and type:
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum