%DECLARE

Purpose

Specifies that an identifier is a preprocessor variable or a preprocessor procedure name.

Syntax

%[label]... DECLARE(ident[dimension,...][,ident]...); 

Abbreviation(s): %DCL for %DECLARE.

Parameters

ident is a PL/I name.

dimension has the format:

[lower-bound:]upper-bound

and shows the lower bound and the upper bound of the dimension of the array. The bounds must be numeric literals and each array must be declared with its own %DECLARE statement.

Note: The array bounds must not be more than 15.

Description

The %DECLARE statement establishes an identifier as a preprocessor variable or a preprocessor procedure name and also serves to activate that identifier with the RESCAN option.

When declaring parameters in a preprocessor procedure, they should all be declared together in the first statement.

CHARACTER (abbreviation, CHAR) specifies that the identifier represents a varying length character string of up to 4096 characters. FIXED specifies that the variable is also given the PL/I attributes DECIMAL (5,0). BIT specifies that the identifier represents a bit string of maximum length 16.

An ENTRY declaration can be specified for each preprocessor entry name in the source program. 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. Preprocessor built-in function names must not be used to name preprocessor procedures.

BUILTIN specifies that the identifier is the preprocessor built-in function of the same name.

Factoring of attributes is allowed. Attributes common to several names can be factored to eliminate repeated specification of the same attribute. Factoring is achieved by enclosing names in parentheses, and following this by a set of attributes that apply to all of the names. Declarations within the parenthesized list are separated by commas.

Example

%DECLARE A FIXED, (B,C) CHARACTER; 
%DECLARE SUBSTR BUILTIN;

/* Note that preprocessor variables B and C are declared using factored declaration. */