VARS statement
Use a VARS statement to set the default values for variables in BCL statements.
For example, rccbuild command rccbuild … -v OPT=LONG assigns a value of LONG to the variable named OPT, overriding any values that were assigned on the VARS statement.
Syntax
//label VARS variable_name1=value1[,variable_name2=value2]…- variable_name#
- The name of the variable to be assigned a default value.
- value#
- The default value to be assigned to the variable.
Example
This example illustrates the use of the VARS statement to establish default values for variables that are used in the BCL statement.
BCL is coded as: | BCL is evaluated as (after variable substitution): |
---|---|
//SETVARS VARS
OPT=LONG,SIZE=10 |
|
//STEP1 EXEC PGM=MYPGM,PARM=
'&OPT' |
//STEP1 EXEC PGM=MYPGM,PARM='LONG' |
//MYDD DD
SPACE=(TRK,(&SIZE)), … |
//MYDD DD SPACE=(TRK,(10)),
… |
This example illustrates the use of the VARS statement
with overrides specified on the rccbuild command.
Supplied command: | |
rccbuild … -v
OPT=SHORT |
|
BCL is coded as: | BCL is evaluated as (after variable substitution): |
//SETVARS VARS
OPT=LONG,SIZE=10 |
|
//STEP1 EXEC PGM=MYPGM,PARM=
'&OPT' |
//STEP1 EXEC PGM=MYPGM,PARM='SHORT' |
//MYDD DD
SPACE=(TRK,(&SIZE)), … |
//MYDD DD SPACE=(TRK,(10)),
… |