Symbolic Parameters


Symbolic parameters allow us to pass information from JCL to procedures (PROCs), making PROCs reusable with different values when calling from different JCLs.

They allow us to pass variable information from JCLs to procedures (PROCs) without changing the actual procedures (PROCs) code. This makes it easier to manage jobs and procedures that need to run with different parameters in different situations.

Symbolic parameters are placeholders or variables used in PROCs. They receive variable data from JCL, which replaces symbolic variables in PROC.

Symbolic parameters can be defined and used in the same JCL.

Syntax -

Defining Symbolic Parameters -

Case 1. Definition using SET statement -

//   SET SYMVAR=value

Case 2. While calling PROC -

//step-name EXEC proc-name,SYMVAR=value

Referencing Symbolic Parameters in PROCs -

//..........&SYMVAR
  • SYMVAR: The name of the symbolic parameter, a combination of letters, numbers, and special characters. The name must start with a letter.
  • Value: Specifies the value assigned to the symbolic parameter.

Rules -

  • While coding symbolic parameters, one to eight alphanumeric character names (including &) are allowed.
  • The first letter should be an ampersand (&), the second letter must be alphabetic, and the rest can be alphanumeric.
  • Keywords are not allowed to be coded as symbolic parameters. For example, PGM, COND, TIME, and PARM are keywords.
  • The symbolic parameter value is overridden when it is passed from JCL. If the value is not passed from JCL, the value defined in PROC will replace the symbolic parameter.
  • The length of the value assigned to a symbolic parameter is not limited.
  • When we code positional parameters as symbolic, then a period should be added between them.
  • If a symbolic parameter is defined, ensure the value is assigned and used in the procedure that determines the parameter.
  • Special characters such as blank space, comma, period (.), slash (/), apostrophe ('), opening/closing braces, ampersand (&), an asterisk (*), plus (+), minus (-), equal (=) can be coded as characters in symbolic parameter.
  • Except the above special characters, all others should be enclosed within apostrophes.

Examples -


Scenario - Define and use symbolic parameters within a JCL job.

//    SET PROG=CBLPROG
//STEP1 EXEC PGM=&PROG

In the above example, PROG is symbolic parameter and these symbolics are used within the EXEC statement to specify the program name.