You can display the values of program variables when you are at a breakpoint.
You can have this done automatically on the breakpoint display by specifying the variable names on the Add Breakpoint (ADDBKP) command, or you can enter the Display Program Variable (DSPPGMVAR) command at the breakpoint by pressing F10 to show the command entry display. Only 10 variables can be specified on one Display Program Variable (DSPPGMVAR) command. For character and bit variables, you can tell the system to begin displaying the value of the variable starting at a certain position and for a specified length. Variables can be displayed in either character or hexadecimal format.
The following Display Program Variable (DSPPGMVAR) command displays the variable ARBAL used in the program CUS310. CUS310 is the default program, so it does not have to be specified. The entire value is to be displayed in character format.
DSPPGMVAR PGMVAR('&ARBAL')
The resulting display looks like this:
Display Program Variables Program . . . . . . . . . . . . . . . . : CUS310 Recursion level . . . . . . . . . . . . : 1 Start position . . . . . . . . . . . . : 1 Format . . . . . . . . . . . . . . . . : *CHAR Length . . . . . . . . . . . . . . . . : *DCL Variable . . . . . . . . . . . . . . . : &ARBAL Type . . . . . . . . . . . . . . . . : PACKED Length . . . . . . . . . . . . . . . : 5 2 '610.00' Press Enter to continue. F3=Exit F12=Cancel
Some HLLs allow variables to be based on a user-specified pointer variable (HLL pointer). If you do not specify an explicit pointer for a based variable, the pointer specified in the HLL declaration (if any) is used. You must specify an explicit basing pointer if one was not specified in the HLL declaration for the based variable. The PGMVAR parameter allows you to specify up to five explicit basing pointers when referring to a based variable. When multiple basing pointers are specified, the first basing pointer specified is used to locate the second basing pointer, the second one is then used to locate the third, and so forth. The last pointer in the list of basing pointers is used to locate the primary variable.