$DSCALL OPT=SUBMIT

Submits JCL.

&CONTROL SHRVARS=($DS)
EXEC $DSCALL OPT=SUBMIT 
           { DSN=dataset_name | 
             VARS=prefix 
             RANGE= ( a , b ) }

This call is used to submit JCL to the JES internal reader for execution. The JCL is contained in a sequential data set or PDS member, or is passed to $DSCALL in variables.

Operands:

OPT=SUBMIT

Specifies that JCL be submitted.

DSN=dataset_name

Specifies the name of the PDS or sequential data set containing the JCL. If the data set name is a PDS, a member name must be specified.

VARS=prefix

The variable name prefix of the variables that contain the JCL.

Note: If VARS= is specified, the relevant variables must be shared to $DSCALL, for example using &CONTROL SHRVARS. The variable names are assumed to be prefixa, prefixb,..., prefixn.

RANGE= (a , b)

The numeric range (of the variable name suffix) for the variables containing the JCL. This operand is valid, and is required, only when the VARS operand is specified.

Return Codes:

Note: For more information about &SYSMSG, &$DSRC, and &$DSFDBK, see Return Codes and Feedback Codes.

Return Variables:

&$DSJOB#

Contains JOBnnnnn where nnnnn is the job number assigned.

Example: OPT=SUBMIT

To submit JCL contained in a data set:

EXEC $DSCALL OPT=SUBMIT DSN=CUSTOMER.DATA.JOBS(REORG)

To submit JCL using a range of variables:

&$TEST1=//FREDX JOB 'SAMPLE', CLASS=A, MSGLEVEL=(1,1), MSGCLASS=T,
&$TEST2=//  NOTIFY=FRED 
&$TEST3=//STEP EXEC PGM=IEFBR14
&$TEST4=//
EXEC $DSCALL OPT=SUBMIT VARS=$TEST RANGE=1,4

Notes:

This function allocates a SYSOUT data set with CLASS=A and PGM=INTRDR. The JCL is obtained from the specified data set or variables and written to the SYSOUT file. When the SYSOUT file is closed, the job number assigned to the submitted job is returned and this value is placed in variable $DSJOB# for return to the caller.

This function does not work if your product region is running under the master scheduler instead of JES.

This function is designed to submit only a single job.