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-41
Field-Characteristic Clauses
clause is used with a PIC X or a PIC A field, the fill character must be a valid
single-byte (ASCII) character.
If this clause is omitted, the default fill character is a space, except on 3270
terminals, where the default fill character is a null. Also on 3270 terminals, if the
data is shorter than the length of the field, the remainder of the field is filled with
nulls.
On input, the trailing FILL characters are removed from the input string before the input
is analyzed for errors and converted. If a TO clause contains a numeric field, the
leading and trailing FILL characters are removed before the input is processed. FILL
characters embedded within a field are not removed.
If FILL and OCCURS clauses are both used with a field, on output the FILL clause
applies to all occurrences of the field, regardless of the setting of data-name-1 in a
DEPENDING ON clause.
LENGTH Clause
The LENGTH clause specifies the acceptable number of characters that can be entered
into a screen input field. The number of characters input is determined before
conversion but after the fill characters are removed.
literal-1 and literal-2
are numeric values from 0 through the field size. If literal-2 is included, its
value must be greater than literal-1.
The maximum value allowed by the compiler is 255.
If this clause is omitted, any number of characters are allowed within the constraints
of the picture.
If the LENGTH clause is used with double-byte fields, the values given to the clause
indicate the number of characters of the given type that the operator must enter. For
example, the clause:
LENGTH MUST BE 6
means one of the following:
•
Six displayable single-byte (ASCII) characters are required for a PIC X(10) field.
•
Six single-byte (ASCII) characters are required for a PIC A(50) field.
•
Six double-byte characters (having 12 bytes total) are required for a PIC N(30) field.
If you use a mixed field, the LENGTH MUST BE clause refers to the absolute number
of bytes that the operator must enter. For example, PIC A(10)N(5)X(5) with a
LENGTH 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
LENGTH [ MUST BE ] {literal-1[ { THROUGH }literal-2 ] }, ...
{ [ { THRU } ] }