Data Definition Language (DDL) Reference Manual

Definition Attributes
Data Definition Language (DDL) Reference Manual529431-004
6-18
MUST BE
You cannot specify a MUST BE clause for fields of some SQL data types (see the
SQL/MP Reference Manual and SQL/MX Reference Manual).
You cannot specify CURRENT, SYSTEM, or SQLNULL as a value for a MUST BE
clause.
Requesters generated by the Pathmaker product enforce the MUST BE constraints;
programs written by users must be coded to enforce these constraints as well.
In Example 6-13 on page 6-18, the MUST BE clause defines the acceptable ranges of
values for days in a month and months in a year.
If you specify the same MUST BE values frequently, you can define the values as
constants. You can also use the constant names in condition-name clauses associated
with the definition.
Example 6-13. MUST BE Clause
DEF date.
02 day PIC 9(2)
MUST BE 1 THROUGH 31.
02 month PIC 9(2).
MUST BE 1 THROUGH 12.
02 year PIC 9(2).
END
Example 6-14. Defining MUST BE Values as Constants
CONSTANT sales VALUE 1.
CONSTANT shipping VALUE 2.
CONSTANT personnel VALUE 3.
DEF company.
02 department TYPE BINARY 16
MUST BE sales,
shipping,
personnel.
88 sales VALUE sales.
88 shipping VALUE shipping.
88 personnel VALUE personnel.
END