Command reference / prog
CHGPGMVAR
Change Program Variable
Updates a character, bit, or numeric variable in a program being debugged. Character and bit strings can be changed in part.
Allowed environments: *ALL.
Positional parameters: 3.
Parameters
PGMVAR
Program variables
Sets the program variable to be changed in a high-level language (HLL) or machine instruction (MI) program.
character-value (program variable)- Enter the name of the program variable to be changed. If the variable name contains special characters, it must be enclosed in apostrophes.
character-value (basing pointer variable)- Enter the name of a basing pointer variable. In some languages, the program variable may be based on a pointer variable. This set of values allows you to explicitly specify as many as 5 basing pointers for the variable to be recorded.
Elements in order
Program variable
Program variable
Suggested / special values:
*CHAR
Basing pointer variable
Basing pointer variable
VALUE
New value
Sets the new value for the program variable. Rules for specifying values depend on the variable type.
START
Char output start position
Specifies, for string variables only, the starting position in the string from which its value is to change. For a bit string, the value specifies the starting bit position; for a character string, the value specifies the starting character position.
1- The first position of the program variable is the starting position in the string to change.
integer- Enter the position number in the program variable that specifies the first position to change in the string.
PGM
Program
Enter the name of the program that contains the program variable whose value is to change.
Suggested / special values:
*DFTPGM
*DFTPGM- The program previously specified as the default program contains the variable to be changed.
name- Enter the name of the program that contains the variable to change. The same name must already have been specified on the Start Debug (STRDBG) or Add Program (ADDPGM) command.
RCRLVL
Recursion level
Select which recursion level of the program contains the variable whose value is to be changed. Changes made to static variables automatically affect all recursion levels. Recursion level 1 is the first (or earliest) call of the program, recursion level 2 is the second call of the program, and so on to the last (most recent) recursion level in the stack.
Suggested / special values:
*LAST
*LAST- The last (most recent) call of the specified program contains the variable to be changed.
integer- Enter the recursion level of the program that contains the variable to be changed.
Examples
DCL VAR(&AMT) TYPE(*DEC) LEN(5 2)
...
CHGPGMVAR PGMVAR('&AMT') VALUE(16.2)
The first command, which is used in a CL program, declares the CL variable &AMT as a five-position decimal value having a 3-digit integer and a 2-digit fraction.
CHGPGMVAR PGMVAR(PARTNO) VALUE('56') START(4)
Changes, starting in position 4, the program variable PARTNO to '56'.
Generated from os/cl/catalog/CHGPGMVAR.json and os/cl/help/CHGPGMVAR.json.