COBOL Manual for TNS/E Programs (H06.03+)

Program Compilation
HP COBOL Manual for TNS/E Programs520347-003
11-47
DIAGNOSE-74 and NODIAGNOSE-74
One instance is that of an UNSTRING statement assigning a value through an
INTO phrase that does not include a DELIMITER phrase, where the DEPENDING
item is within the receiving data structure. COBOL 74 uses the computed size of
the receiving item, but HP COBOL uses the maximum size.
Another, more general case is when a MOVE, UNSTRING, or some other value-
delivering statement stores a value into a data structure that contains an item
described with an OCCURS DEPENDING clause, where the DEPENDING item is
not part of the receiving (group) item. COBOL 74 used the maximum size of the
receiving item in performing the storage operation in all cases but the one
mentioned in the previous paragraph. HP COBOL uses the computed size in all
cases where the DEPENDING item is not part of the receiving item.
You must check that the value-assigning statement will do what you want it to do.
Identification of Statement Operand
In COBOL 74, STRING and UNSTRING statements deferred some subscript
evaluations until just before the subscripted item was used. HP COBOL evaluates
all subscripts once at the beginning of the statement’s execution.
You must check that the STRING and UNSTRING statements do what you want
them to do.
Assignment Order of PERFORM Operands
In COBOL 74, when a PERFORM VARYING statement controlled multiple loops by
using the AFTER phrase, the inner loop base was set before the outer loop index
was incremented (or decremented). In HP COBOL, these steps are reversed.
When the inner loop logic uses the value of the outer loop’s index, the behavior is
different. For example, the statement:
PERFORM p1 VARYING x FROM 1 BY 1 UNTIL x = 5
AFTER y FROM x BY 1 UNTIL y = 5.
Under COBOL 74 rules, the preceding statement performs these steps in this
order:
1. Sets x to 1, sets y to 1
2. Runs y from 1 through 4
3. Sets y to the value of x (still 1), sets x to 2
4. Runs y from 1 through 4
5. Sets y to the value of x (now 2), sets x to 3
6. Runs y from 2 through 4
7. Sets y to the value of x (now 3), sets x to 4
8. Runs y from 3 through 4
9. Terminates
In HP COBOL, the same statement performs these steps in this order:
1. Sets x to 1, sets y to 1
2. Runs y from 1 through 4
3. Sets x to 2, sets y to the value of x (now 2)