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
SETcommand 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
TRUEonly 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.
SETassigns a value only to a single receiver; unlike COBOL, multiple receiver variables are not supported.- Only formats 1, 4 and 5 of the COBOL
SETcommand are supported. - Index-names can only be program variables (because
OCCURSis not supported for the z/OS Debugger session variables). - COBOL
ADDRESS OFidentifier is supported only for identifiers that areLINKAGE SECTIONvariables. In addition, COBOLADDRESS OFas a receiver must be level 1 or 77, and COBOLADDRESS OFas a sender can be any level except 66 or 88. - z/OS Debugger provides
a hexadecimal constant that can be used with the
SETcommand, where the hexadecimal value is preceded by an "H" and delimited by quotation marks (") or apostrophes ('). - If the
DATAoption of thePLAYBACK ENABLEcommand is in effect, you can use theSETcommand 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
SETcommand to assign a value to a program variable only if you first enter theSET WARNING OFFcommand. The source or target of theSETcommand 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
inx1toinx2.SET inx2 TO inx1; - Assign the value of an invalid address (nonnumeric 0) to
ptrand:SET ptr TO NULL; - Assign the address of
onetoptr.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
