Data Definition Language (DDL) Reference Manual

Definition Attributes
Data Definition Language (DDL) Reference Manual529431-004
6-79
VALUE
For C and Pascal, a NOVALUES clause on a group definition has no effect on
subgroups defined by reference to other groups.
SQLNULL is valid only for SQL-nullable elementary line items (that is, SQL items that
are not specified as NOT NULL). If the type was previously defined, the definition must
be an SQL-nullable field definition.
The values SYSTEM, CURRENT, and SQLNULL cannot be specified in a MUST BE
clause, an 88 condition-name clause, or an 89 enumeration clause
If you specify a MUST BE clause and VALUE SYSTEM for the same item, the DDL
compiler does not check the value SYSTEM against the specified MUST BE constraint.
Similarly, if you specify a MUST BE clause and VALUE SQLNULL for the same item,
the DDL compiler does not check the value SQLNULL against the specified MUST BE
constraint.
The initial values assigned in Example 6-62 on page 6-79 are overridden and
suppressed by the statements in Example 6-63 on page 6-79.
Example 6-62. Assigning Initial Values With VALUE Clauses
DEF price PIC 9(5)V99 VALUE IS ZERO.
DEF name VALUE SPACES.
02 last PIC X(20).
02 first PIC X(12).
02 midinit PIC X(2).
END
Example 6-63. Overriding and Suppressing VALUE Clauses
DEF base-price TYPE price
VALUE is 20.00. ! Overrides initial value
DEF cust-name TYPE name
NOVALUE. ! Suppresses initial value
Example 6-64. Enumeration Values in VALUE Clauses
DEF prts-ddl-object-type TYPE ENUM BEGIN AS "Miscellaneous".
88 bolt VALUE prts-enm-bolt.
88 nut VALUE prts-enm-nut.
88 pin VALUE prts-enm-pin.
88 screw VALUE prts-enm-screw.
88 washer VALUE prts-enm-washer.
89 prts-enm-bolt VALUE IS prts-obj-bolt AS "Bolt".
89 prts-enm-nut VALUE IS prts-obj-nut AS "Nut".
89 prts-enm-pin VALUE IS prts-obj-pin AS "Pin".
89 prts-enm-screw VALUE IS prts-obj-screw AS "Screw".
89 prts-enm-washer VALUE IS prts-obj-washer AS "Washer".
END.