Dictionary/3000 Reference Manual (32244-90001)

Chapter 7 271
The Dictionary DICTCDE Utility
Examples of Generated Code
Edit Masks
Display fields can be generated for elements defined with edit masks in the Dictionary. If
the edit mask is enabled (see the Options response to the main prompt), DICTCDE will
generate a PICTURE clause for the edit mask. Table 7-1 shows how the edit masks are
generated as COBOL PICTURE characters.
When code is generated for elements with edit masks, the display size for the elements is
generated according to the display size defined in the Dictionary. However, the storage
length is changed when code is generated for edit masks. For entities which contain child
elements with edit masks, the record layout for the parent entity is also changed.
Therefore, the byte offsets for the elements with edit masks must be defined in the
Dictionary according to the edit mask size, not by the data storage requirements. (This
may require changes to the existing definitions in the Dictionary.)
When defining a parent element or file with edit masks in the Dictionary, you should
manually define the byte offsets for that entity in the Dictionary according to the COBOL
storage lengths for their edit masks. Otherwise, the child elements will probably overlap
each other. To compute the required storage length, add one byte for each COBOL
PICTURE clause character. The storage length of the parent element should also be
defined as the total storage lengths of the child elements with their edit masks, to ensure
that the child elements all fit within the record layout.
Table 7-1. Edit Mask to COBOL PICTURE Clause Characters
Dictionary Edit Mask COBOL PICTURE
Clause Characters
Comments
^ X or 9 X if data type is X or U, otherwise 9
, / $ * Z , / $ * Z These are valid COBOL characters
. Note that only one period may appear
(blank) B
CR CR
DR DR COBOL only recognizes DB.
! ERROR COBOL does not have an equivalent
Any other ERROR No other characters are allowed