SET command (COBOL)
The SET
command assigns a value to a COBOL reference.
The SET
keyword cannot be abbreviated.
- reference
- A valid z/OS® Debugger COBOL reference.
- literal
- A valid COBOL numeric literal constant.
TRUE
- The value assigned to a COBOL level-88 reference.
Usage
notes
- For Enterprise COBOL for z/OS Version
5, you cannot use the
SET
command to set an index with a non-integer data item (e.g.PIC 9v9
). - For Enterprise COBOL for z/OS Version 5, you can set a pointer to the address of an array. The pointer is set to the start of the array.
- You can assign the value
TRUE
only to a COBOL level-88 reference. - If z/OS Debugger was started because of a computational condition or an attention interrupt, using an assignment to set a variable might not give expected results. This is due to the uncertainty of variable values within statements as opposed to their values at statement boundaries.
SET
assigns a value only to a single receiver; unlike COBOL, multiple receiver variables are not supported.- Only formats 1, 4 and 5 of the COBOL
SET
command are supported. - Index-names can only be program variables (because
OCCURS
is not supported for the z/OS Debugger session variables). - COBOL
ADDRESS OF
identifier is supported only for identifiers that areLINKAGE SECTION
variables. In addition, COBOLADDRESS OF
as a receiver must be level 1 or 77, and COBOLADDRESS OF
as a sender can be any level except 66 or 88. - z/OS Debugger provides
a hexadecimal constant that can be used with the
SET
command, where the hexadecimal value is preceded by an "H" and delimited by quotation marks (") or apostrophes ('). - If the
DATA
option of thePLAYBACK ENABLE
command is in effect, you can use theSET
command to assign a value only to a session variable. You cannot assign a value to a program variable. - If you are debugging an optimized COBOL program, you can use the
SET
command to assign a value to a program variable only if you first enter theSET WARNING OFF
command. The source or target of theSET
command cannot reference a variable that was discarded by the optimizer.
Examples
- Assign the value 3 to
inx1
, the index toitm-1
.SET inx1 TO 3;
- Assign the value of
inx1
toinx2
.SET inx2 TO inx1;
- Assign the value of an invalid address (nonnumeric 0) to
ptr
and:SET ptr TO NULL;
- Assign the address of
one
toptr
.SET ptr TO ADDRESS OF one;
- Assigns the hexadecimal value of '20000' to the pointer
ptr
.SET ptr TO H'200000';
Refer to the following topics for more information related to the material discussed in this topic.
- Related tasks
- IBM® z/OS Debugger User's Guide
- Related references
- Allowable moves for the z/OS Debugger SET command