Dictionary/3000 Reference Manual (32244-90001)

262 Chapter7
The Dictionary DICTCDE Utility
Examples of Generated Code
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 KORDER
000300 RECORDING MODE IS F.
000400 01 KORDER-REC PIC X(52).
000500
000600 01 KORDER-DATA.
000700 05 CUST-NUM PIC S9(8).
000800 05 CUST-CREDIT-LIM PIC S9(8).
000900 05 CUST-BALANCE PIC S9(10).
001000 05 INVOICE-NUM PIC S9(8).
001100 05 INVOICE-TOTAL PIC S9(10).
001200 05 INVOICE-DATE PIC X(8).
This will only be of use when the file is being accessed by the KSAM COBOL intrinsics. If
the file is defined in the SELECT Statement as ORGANIZATION INDEXED, and the keys
have been defined, then COBOL requires that the record layout be generated in the FILE
SECTION.
Note that the size generated for KORDER-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.
KSAM 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.
Each record layout will follow the other in the FD Statement as follows:
000100
000200 FD KORDER
000300 01 KORDER-DATA.
000400 05 RECORD-LAYOUT-1 PIC X(80).
000500 01 KORDER-DATA2.
000600 05 RECORD-LAYOUT-2-1 PIC X(40).
000700 05 RECORD-LAYOUT-2-2 PIC X(40).
Note that KORDER-DATA2 is defined in the Dictionary as a parent element with 2 child
elements.
If the record layout is to be generated in WORKING-STORAGE and the file has more than
one record format, DICTCDE will use an explicit REDEFINES to define the multiple
record layouts. The generated code for the FD Statement and for WORKING-STORAGE is