COBOL Manual for TNS and TNS/R Programs
Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
9-226
SET UP or SET DOWN
Usage Considerations:
•
Do Not Use SET UP or SET DOWN for Record Pointers
Do not use SET UP or SET DOWN to point a record pointer at a different record.
This would be syntactically correct, but the memory positions of records are not
defined in HP COBOL and can vary between implementations.
•
Incompatibility With IBM/370 Mainframe Pointer Variables
If you redefine a VS COBOL II pointer variable as a COMP field and perform an
arithmetic operation on the field to change the value of the pointer, the pointer does
not behave the same as it would in IBM/370 COBOL. The reason is that pointer
format depends on machine architecture, and HP and IBM/370 machines have
different architectures.
Nonpointer Data Items
SET UP increments an index value by an integer amount. SET DOWN decrements an
index value by an integer amount.
index-name
is the name of an index whose value is to be incremented or decremented.
identifier
is the identifier of an integer numeric item whose value UP adds to the index or
DOWN subtracts from the index.
integer
is an integer that UP adds to the index or DOWN subtracts from the index. It can
be signed.
The value of each index-name is incremented (UP) or decremented (DOWN) by a
value corresponding to the number of occurrences represented by identifier or
integer. Each time, the identifier of an integer numeric item is used as it was at the
beginning of the execution of the statement.
Both before and after the execution of the SET statement, the value of the index must
correspond to an occurrence number of an element in the associated table.
BY
SET index-name UP
identifier
integer
DOWN
VST212.vsd