Pathway/iTS SCREEN COBOL Reference Manual (H06.10+, J06.03+)
Data Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual—426750-003
5-8
JUSTIFIED Clause
JUSTIFIED Clause
The JUSTIFIED clause causes nonstandard positioning of data within a receiving item.
The clause can only appear in the data description of an elementary item; the clause
cannot be used for a data item that is described as numeric.
When the JUSTIFIED clause is omitted, standard alignment rules dictate that
alignment is left justified and truncation or padding, when necessary, occurs on the
right.
When a receiving data item is described with the JUSTIFIED clause, the standard
alignment rules do not apply. If a sending item is too big for the receiving item, the
sending item is truncated on the left. If the sending item is smaller than the receiving
item, the rightmost character of the sending item is aligned with the rightmost character
of the receiving field and the value is extended to the left with space characters.
Right justification does not strip trailing blanks from the sending field. Suppose, for
example, that the Working-Storage Section includes:
01 WS-FIELD-1 PIC X(12)
01 WS-FIELD-2 PIC X(14) JUSTIFIED RIGHT.
In addition, in the Screen Section a field is defined as:
05 SCREEN-FIELD-1 PIC X(10)
USING WS-FIELD-1.
Suppose the user enters “ABCDEFGHIJ” into SCREEN-FIELD-1, presses a valid
function key, and an ACCEPT statement causes data to be moved into WS-FIELD-1.
The data is then moved from WS-FIELD-1 to WS-FIELD-2 using the MOVE statement.
As a result of this sequence of operations, the three fields then appear as follows:
SCREEN-FIELD-1 = "ABCDEFGHIJ" (ten bytes)
WS-FIELD-1 = "ABCDEFGHIJ " (twelve bytes)
WS-FIELD-2 = " ABCDEFGHIJ " (fourteen bytes)
Although right justification and leading-blank padding have occurred, trailing blanks
from the input field were not stripped. Trailing blanks can be stripped from screen
input fields during the execution of an ACCEPT statement by means of an
alphanumeric input user conversion routine. Alternatively, logic for stripping trailing
blanks can be included in a server program.
{ JUST } RIGHT
{ JUSTIFIED }
Note. The JUSTIFIED clause is ignored when an item with the literal given in a VALUE clause
is initialized.










