COBOL Manual for TNS/E Programs (H06.03+)
Procedure Division Verbs
HP COBOL Manual for TNS/E Programs—520347-003
9-213
SET UP or SET DOWN
POINTER Data Items
SET UP increments a pointer by an integral number of memory locations. SET DOWN
decrements a pointer by an integral number of memory locations.
pointer
is a data item with USAGE POINTER. In these parameter descriptions, assume
that the value of pointer is the address p.
number-of-locations
identifier-1
is either an elementary numeric data item described as an integer or a function
that returns an integer value. If number-of-locations is identifier-1,
and the value of identifier-1 is n, then pointer is adjusted so that it
references the address p +n bytes for SET UP or p -n bytes for SET DOWN.
integer
is a numeric literal whose value is an integer. If number-of-locations is
integer, then pointer is adjusted so that it references the address
p +integer bytes for SET UP or p -integer bytes for 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.
SET BYpointer UP
DOWN
number-of-locations
VST608.vsd
identifier-1
integer
VST609.vsd










