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

%DECLARE Statement

The %DECLARE statement establishes an identifier as a macro variable, macro procedure, or built-in function. In addition, scanning status can be specified for macro variables.

Read syntax diagramSkip visual syntax diagram               .-,-------------------------------------.
               V                                       |
>>-%--DECLARE----+-identifier-----------+--+-BUILTIN-+-+--;----><
                 |    .-,----------.    |  '-ENTRY---'
                 |    V            |    |
                 '-(----identifier-+--)-'
 

Or

Read syntax diagramSkip visual syntax diagram               .-,--------------------------.
               V                            |
>>-%--DECLARE----| identifier description |-+--;---------------->
 
>--| identifier description: |---------------------------------->
 
>--+-identifier-+-------------------+---------+----------------->
   |            '-(-| dimension |-)-'         |
   |   .-,--------------------------------.   |
   |   V                                  |   |
   '-(---identifier-+-------------------+-+-)-'
                    '-(-| dimension |-)-'
 
>--+----------------+------------------------------------------><
   '-| attributes |-'
 
dimension:
 
     .-,---------------------.
     V                       |
|--+---+-----------+--hbound-+-+--------------------------------|
   |   '-lbound--:-'           |
   | .-,-.                     |
   | V   |                     |
   '---*-+---------------------'
 
attributes:
 
   .-CHARACTER-.
|--+-----------+--+--------------+--+------------+--------------|
   '-FIXED-----'  +-EXTERNAL-----+  +-NOSCAN-----+
                  | .-INTERNAL-. |  +-SCAN-------+
                  '-+----------+-'  | .-RESCAN-. |
                                    '-+--------+-'
 

Abbreviations: %DCL for %DECLARE, CHAR for CHARACTER, INT for INTERNAL, EXT for EXTERNAL

identifier description
Specifies the names and attributes of macro facility identifiers.
BUILTIN
Specifies that the identifier is the preprocessor built-in function of the same name.
CHARACTER
Specifies that the identifier represents a varying-length character string that has no maximum length.
ENTRY
Specifies that the identifier is a preprocessor procedure.

The declaration activates the entry name.

The declaration of a preprocessor procedure entry name can be performed explicitly by its appearance as the label of a %PROCEDURE statement. This explicit declaration, however, does not activate the preprocessor procedure name.

FIXED
Specifies that the identifier represents an integer.

Under the (default) FIXED(DECIMAL) option, it is also given the attributes DECIMAL(5,0).

Under the FIXED(BINARY) option, it is also given the attributes BINARY(31,0).

RESCAN
Specifies that the identifier is active and is replaced as many times as necessary.
SCAN
Specifies that the identifier is active and is replaced only once in output.
NOSCAN
Specifies that the identifier is inactive and is not to be replaced in output.
dimension
Dimension specification for array variables. No more than 15 dimensions may be specified.

Note: While an array may be declared outside of a preprocessor procedure (so that it can be shared across multiple procedures), it may not be referenced outside a procedure (except as the first argument to one of the array-enquiry built-in functions).

lbound
The desired lower bound for that dimension. The default is 1.
hbound
The desired upper bound for that dimension.
INTERNAL
This attribute is valid only inside a procedure. If specified outside a procedure, a diagnostic message is issued and the variable is given the EXTERNAL attribute.

All variables declared outside a procedure are EXTERNAL, and all variables declared inside a procedure are INTERNAL.

EXTERNAL
This attribute is valid only outside a procedure. If specified inside a procedure, a diagnostic message is issued and the variable is given the INTERNAL attribute.

Terms of use | Feedback

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