Dictionary/3000 Reference Manual (32244-90001)

Chapter 7 267
The Dictionary DICTCDE Utility
Examples of Generated Code
ELEMENT-SIZE = 36
ELEMENT-LENGTH = 36
ELEMENT-COUNT = 1
CHILD-ELEMENTS = NAME ADDRESS COST
ELEMENT-TYPE = X X X
ELEMENT-SIZE = 9 2 5
ELEMENT-LENGTH = 9 2 5
ELEMENT-COUNT = 1 1 5
ELEMENT-BYTE POSITION = 1 10 12
The code for the element ACCOUNT is generated as follows:
000100
000200 01 FILLER.
000300 05 ACCOUNT OCCURS 10.
000400 10 ACCOUNT-MASTER.
000500 15 NAME PIC X(9).
000600 15 ADDRESS PIC X(2).
000700 15 COST PIC X(5) OCCURS 5.
In the above case, ACCOUNT-MASTER is generated only to include NAME, ADDRESS,
and COST as elements of table ACCOUNT.
Element to Element Relationships
DICTCDE handles element-to-element relationships (child elements to parent elements)
differently depending on how the storage lengths and byte positions are defined in the
Dictionary for the child elements. In the first example, the storage length of the parent
element (as defined in the Dictionary) is equal to the sum of the storage lengths for the
child elements. The byte positions for the child elements have been defined in the
Dictionary to allow the child elements to consecutively follow each other within the parent
element. For this example, the element SALES has the elements PRODUCT, PRICE and
AMOUNT as child elements. The element SALES is defined in the Dictionary as:
PARENT-ELEMENT = SALES
ELEMENT-TYPE = X
ELEMENT-SIZE = 50
ELEMENT-LENGTH = 50
The child elements are defined in the Dictionary as:
CHILD-ELEMENTS = PRODUCT PRICE AMOUNT
ELEMENT-TYPE = X X X
ELEMENT-SIZE = 12 28 10
ELEMENT-LENGTH = 12 28 10
ELEMENT-BYTE POSITION = 1 13 41