Declaring variables to a CL program or procedure

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

There are two ways of declaring variables:

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

Rules for using the Declare CL Variable 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: