Declare a variable

All variables must be declared (defined) to the CL procedure before they can be used by the procedure.

There are two ways of declaring variables:

The declare commands must precede all other commands in the procedure (except the PGM command), but they can be intermixed in any order.

Declare CL Variable (DCL) command

In its simplest form, the Declare CL Variable (DCL) command has the following parameters:


Declare CL Variable (DCL) command has these parameters

When you use a DCL command, you must use the following rules:

Related information
Declare CL Variable (DCL) command