Dictionary/3000 Reference Manual (32244-90001)

258 Chapter7
The Dictionary DICTCDE Utility
Examples of Generated Code
When the record layout is generated in WORKING-STORAGE and no FD Statement is
generated, the code will be generated as shown below:
000100
000200 01 CUSTMPE-DATA.
000300 05 CUST-NUM PIC S9(8).
000400 05 CUST-CREDIT-LIM PIC S9(8).
000500 05 CUST-BALANCE PIC S9(10).
000600 05 INVOICE-NUM PIC S9(8).
000700 05 INVOICE-TOTAL PIC S9(10).
000800 05 INVOICE-DATE PIC X(8).
000900 05 FILLER PIC X(971).
When the record layout is generated in WORKING-STORAGE and the FD Statement is
also generated, the 01-level definition will appear in the FD Statement to serve as a buffer
for READs and WRITEs to the file. The generated code is shown below:
000100
000200 FD CUSTMPE
000300 RECORD CONTAINS 1023 CHARACTERS
000400 RECORDING MODE IS S.
000500 01 CUSTMPE-REC PIC X(1023).
000100
000200 01 CUSTMPE-DATA.
000300 05 CUST-NUM PIC S9(8).
000400 05 CUST-CREDIT-LIM PIC S9(8).
000500 05 CUST-BALANCE PIC S9(10).
000600 05 INVOICE-NUM PIC S9(8).
000700 05 INVOICE-TOTAL PIC S9(10).
000800 05 INVOICE-DATE PIC X(8).
000900 05 FILLER PIC X(971).
Note that the size generated for CUSTMPE-REC is derived from the Dictionary definition
for the record size of the file. However, if the record size of the file was not defined in the
Dictionary, DICTCDE will compute its size from the record layout size. For a file with
multiple record formats, only the size of the primary record format will be used in
computing the file's record size. Files with multiple record layouts can also be generated by
DICTCDE. If the record layout is to be generated in the FD statement and the file has
more than one record layout, DICTCDE will use an implicit REDEFINES to define the
multiple record layouts. (In other words, DICTCDE lays out the multiple record layouts,
one after the other, which implicitly shows their relationship.) Each record layout will
follow the other in the FD Statement as follows:
000100
000200 FD CUSTMPE