Accessing PL/I program variables

z/OS® Debugger obtains information about a program variable by name using information that is contained in the symbol table built by the compiler. The symbol table is made available to the compiler by compiling with TEST(SYM).

z/OS Debugger uses the symbol table to obtain information about program variables, controlled variables, automatic variables, and program control constants such as file and entry constants and also CONDITION condition names. Based variables, controlled variables, automatic variables and parameters can be used with z/OS Debugger only after storage has been allocated for them in the program. An exception to this is DESCRIBE ATTRIBUTES, which can be used to display attributes of a variable.

Variables that are based on any of the following data types must be explicitly qualified when used in expressions:

  • an OFFSET variable
  • an expression
  • a pointer that is either BASED or DEFINED
  • a parameter
  • a member of either an array or a structure
  • an address of a member of either an array or a structure

For example, assume you made the following declaration:

DECLARE P1 POINTER;
DECLARE P2 POINTER BASED(P1);
DECLARE DX FIXED BIN(31) BASED(P2);

You would not be able to reference the variable directly by name. You can only reference it by specifying either:

P2->DX
  or
P1->P2->DX
The following types of program variables cannot be used with z/OS Debugger:
  • iSUB defined variables
  • Variables defined:
    • On a controlled variable
    • On an array with one or more adjustable bounds
    • With a POSITION attributed that specifies something other than a constant
  • Variables that are members of a based structure declared with the REFER options.

Refer to the following topics for more information related to the material discussed in this topic.