DECLARE command (PL/I)
The DECLARE
command declares session variables
that are effective during a z/OS® Debugger session.
Variables declared this way can be used in other z/OS Debugger commands
as if they were declared to the compiler. They are removed with the CLEAR
command
or when your z/OS Debugger session
ends. The keywords cannot be abbreviated.
- level
- An unsigned positive integer. Level 1 must be specified for major structure names.
- name
- A valid PL/I identifier. The name must be unique within a particular
structure level. When name conflicts occur, z/OS Debugger uses session variables before using other variables of the same name that appear in the running programs. Use qualification to refer to the program variable during a z/OS Debugger session. For example, to display the variable
a
declared with theDECLARE
command as well as the variablea
in the program, issue theLIST
command as follows:LIST (a, %BLOCK:a);
If a name conflict occurs because the variable was declared earlier with a
DECLARE
command, the new declaration overrides the previous one. - attribute
- A PL/I data or storage attribute. Acceptable PL/I data attributes include:
BINARY CPLX FIXED LABEL PTR BIT DECIMAL FLOAT OFFSET REAL CHARACTERS EVENT GRAPHIC POINTER VARYING COMPLEX
Acceptable PL/I storage attributes include:BASED ALIGNED UNALIGNED
Pointers cannot be specified with the
BASED
option.Only simple factoring of attributes is allowed.DECLARE
s such as the following are not allowed:DCL (a(2), b) PTR; DCL (x REAL, y CPLX) FIXED BIN(31);
Also, the precision attribute and scale factor as well as the bounds of a dimension can be specified. If a session variable has dimensions and bounds, these must be declared following PL/I language rules.
Usage notes
DECLARE
is not valid as a subcommand. That is, it cannot be used as part of aDO/END
orBEGIN/END
block.- Initialization is not supported.
- Program
DEFAULT
statements do not affect theDECLARE
command. - If you are debugging a Enterprise PL/I program, you cannot declare arrays, structures, factor attributes, or multiple session variables in one command line.
- The
DECLARE
command cannot be used while you replay recorded statements by using thePLAYBACK
commands.
- Declare
x
,y
, andz
as variables that can be used as pointers.DECLARE (x, y, z) POINTER;
- Declare
a
as a variable that can represent binary, fixed-point data items of 15 bits.DECLARE a FIXED BIN(15);
- Declare
d03
as a variable that can represent binary, floating-point, complex data items.
ThisDECLARE d03 FLOAT BIN COMPLEX;
d03
will have the attribute ofFLOAT BINARY(21)
. - Declare
x
as a pointer, andsetx
as a major structure with structure elementsa
andb
as fixed-point data items.
ThisDECLARE x POINTER, 1 setx, 2 a FIXED, 2 b FIXED;
a
andb
will have the attributes ofFIXED DECIMAL(5)
.
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
Refer to the following topics for more information related to the material discussed in this topic.
- Related references
- Enterprise PL/I for z/OS Language Reference