PARAMETER

A parameter is contextually declared with the parameter attribute by specifying it in a PROCEDURE or ENTRY statement. The parameter should be explicitly declared with appropriate attributes.

The PARAMETER attribute can also be specified in the contextual declaration. If attributes are not supplied in a DECLARE statement, default attributes are applied. The parameter name must not be subscripted or qualified.

A name that appears in the parameter list of a PROCEDURE or ENTRY statement may be given the PARAMETER attribute.

This example shows the use of the PARAMETER attribute in a DECLARE statement.

sub: proc (i, j);

    dcl i fixed bin (31) ;            /* ok */
    dcl j fixed bin (31) parameter;   /* ok */
    dcl k fixed bin (31) parameter;   /* incorrect, not a parameter */

end;