Pathway/iTS SCREEN COBOL Reference Manual (G06.24+, H06.03+, Pathway/iTS 1.0+)
Data Division
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual—426750-001
5-42
Field-Characteristic Clauses
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
Table 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.
The literals used in this clause must match for the screen field and the associated data
item, or an error is generated. For example, if a screen field receives alphanumeric
character data, that data must go into a data item that is defined with a nonnumeric
PICTURE clause. Numeric items are compared numerically; alphanumeric items are
compared left to right according to the ASCII character set. For example, an input string
mnemonic-name
MUST [ BE ] { literal-1 [ { THROUGH } literal-2 ] } , ...
{ [ { THRU } ] }