Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Language Reference Manual

DECLARE statement

The DECLARE statement specifies some or all of the attributes of a name. If the attributes are not explicitly declared and cannot be determined by context, default attributes are applied.

DECLARE statements can be an important part of the documentation of a program. Consequently, you can make liberal use of declarations, even when default attributes suffice or when an implicit declaration is possible. Because there are no restrictions on the number of DECLARE statements, you can use different DECLARE statements for different groups of names. Any number of names can be declared in one DECLARE statement.

Read syntax diagramSkip visual syntax diagram            .-,-------------------------------------------.
            |                      .--------------------. |
            V                      V                    | |
>>-DECLARE----+-------+--+-name-+----+----------------+-+-+----->
              '-level-'  '-*----'    '-| attributes |-'
 
                       .------------------------------.
                       V                              |
>--;--| attributes: |----+-data-attributes----------+-+--------><
                         +-alignment-attributes-----+
                         +-scope-attributes---------+
                         +-storage-attributes-------+
                         '-complementary-attributes-'
 

Abbreviation: DCL

For more information about declaring arrays, structures, and unions, refer to Arrays, Structures, or Unions.

*
Cannot be used as the name of an INTERNAL or an EXTERNAL scalar or as the name of a level-1 EXTERNAL structure or union unless the EXTERNAL attribute specifies an environment name (see INTERNAL and EXTERNAL attributes).
attributes
The attributes can appear in any order.

All attributes given explicitly for the name must be declared together in a DECLARE statement, except that:

Attributes of external names, in separate blocks and compilations, must be consistent.

For more information about attributes and the members of the given groups, refer to Data types and attributes.

level
A nonzero integer. If a level-number is not specified, level 1 is the default for element and array variables. Level 1 must be specified for major structure and union names.
name
Each level-1 name must be unique within a block. For more information on level-1 names, refer to Structures.

Condition prefixes and labels cannot be specified on a DECLARE statement.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)