Pathway/iTS SCREEN COBOL Reference Manual (H06.10+, J06.03+)

Data Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual426750-003
5-42
Field-Characteristic Clauses
MUST BE 6 clause means that an operator must enter six alphabetic characters. A
LENGTH MUST BE 11 clause is not possible here because the operator would have to
enter ten alphabetic characters for the first ten bytes—and half of a double-byte
character for the eleventh byte.
The following example specifies that FLD1 is optional (length can be 0), but must be
five characters long if it is entered; FLD2 is required, but 1 through 5 characters can be
entered.
04 FLD1 AT 1, 1 TO X PIC A9999 LENGTH 0, 5.
04 FLD2 AT 2, 1 TO Y PIC ZZZZ9 LENGTH 1 THRU 5.
When a field is optional and no characters are input, the value of the associated data
item is changed by the ACCEPT statement according to the WHEN ABSENT/BLANK
field-characteristic clause.
Mnemonic-Name Clause
The mnemonic-name clause allows you to specify display attributes for a screen field.
The mnemonic-name is associated with a display attribute in the SPECIAL-NAMES
paragraph of the Environment Division.
The display attributes combined with the default values for unspecified attributes
determine the display attributes for the field when the field is displayed initially. Display
attributes can be restored by a RESET statement, as described in Section 6,
Procedure Division.
The default value for the protection attribute depends on the screen field type. If the
field is an input or input-output field, the default is UNPROTECTED. If the field is an
output field, the default is PROTECTED.
A
mnemonic-name
can be associated with the display attribute system names listed in
Tabl e 4- 1
and Table 4-2.
MUST BE Clause
The MUST BE clause specifies the acceptable values for an input screen field.
literal-1
and
literal-2
are numeric literals for numeric items and nonnumeric literals for alphanumeric
items.
Any figurative constant except ALL can be specified.
mnemonic-name
MUST [ BE ] {
literal-1
[ { THROUGH }
literal-2
] } , ...
{ [ { THRU } ] }