Dictionary/3000 Reference Manual (32244-90001)

264 Chapter7
The Dictionary DICTCDE Utility
Examples of Generated Code
Example
The following is an example of the code generated for a KSAM file. (Note that the SELECT
statement and FD statement have both been generated.)
000100
000200 SELECT KORDER
000300 ASSIGN "KORDER"
000400 ORGANIZATION IS INDEXED
000500 RECORD KEY IS CUST-NUM
000600 ALTERNATE RECORD KEY INVOICE-NUM
000700 ALTERNATE RECORD KEY INVOICE-DATE WITH DUPLICATES.
000800
000900 FD KORDER
001000 RECORDING MODE IS F.
001100 01 KORDER-DATA.
001200 05 CUST-NUM PIC S9(8).
001300 05 CUST-CREDIT-LIM PIC S9(8).
001400 05 CUST-BALANCE PIC S9(10).
001500 05 INVOICE-NUM PIC S9(8).
001600 05 INVOICE-TOTAL PIC S9(10).
001700 05 INVOICE-DATE PIC X(8).
Element Definitions
DICTCDE allows you to generate source code for any data element defined in the
Dictionary. The code is generated in WORKING-STORAGE. Each element is generated as
an 01-level data definition. Any child elements related to the element are generated as an
05-level identifier, 10-level identifier and so forth. If the alias option is enabled when the
code is generated, then any child element will be generated with its alias as its COBOL
identifier.
Example
The following is an example of the code generated for an element with no child elements:
000200 01 CUST-NUM PIC S9(8).
The next example shows the code generated for an element that has child elements:
000100
000200 01 RECORD1.
000300 05 FIELD1 PIC X(2).
000400 05 FIELD2 PIC X(8).
000500 05 FIELD3 PIC X(6).