Dictionary/3000 Reference Manual (32244-90001)

268 Chapter7
The Dictionary DICTCDE Utility
Examples of Generated Code
The code for element SALES is generated as follows:
000100
000200 01 SALES.
000300 05 PRODUCT PIC X(12).
000400 05 PRICE PIC X(28).
000500 05 AMOUNT PIC X(10).
Note that the COBOL record would be represented in storage as a memory array of a
length of 50 bytes, with PRODUCT being from byte 1 to 12, PRICE from byte 13 to 40 and
AMOUNT from byte 41 to 50.
In the next example of element-to-element relationships, the storage length for the parent
element is defined in the Dictionary. The child elements are defined at specified offsets
defined in the Dictionary, within the parent element's storage. If there is a gap between the
memory areas of two consecutive child elements, DICTCDE generates FILLER items in
order to place the child elements at the proper offset within the parent element and to
assign the correct size to the parent element. Therefore, when the parent element is
accessed, the correct amount of memory will be available for it. Also, when the child
element is accessed, it will be at the correct offset within the parent. For example, the
element ADDRESS has the elements STREET and YEARS related to it. The element
ADDRESS is defined in the Dictionary as:
PARENT-ELEMENT = ADDRESS
ELEMENT-TYPE = X
ELEMENT-SIZE = 48
ELEMENT-LENGTH = 48
The child elements are defined in the Dictionary as:
CHILD-ELEMENTS = STREET YEARS
ELEMENT-TYPE = X I
ELEMENT-SIZE = 12 5
ELEMENT-LENGTH = 12 4
ELEMENT-BYTE POSITION = 4 30
Note that ADDRESS requires a storage length of 48 bytes. Therefore, when DICTCDE
generates the code for ADDRESS, a FILLER is used at the end to fill up the 48 bytes.
000100
000200 01 ADDRESS.
000300 05 FILLER PIC X(3).
000400 05 STREET PIC X(12).
000500 05 FILLER PIC X(14).
000600 05 YEARS PIC S9(5) COMP.
000700 05 FILLER PIC X(15).