Running an Exec in the Background

Execs run in the background are processed when higher priority programs are not using the system. Background processing does not interfere with a person's use of the terminal. You can run time-consuming and low priority execs in the background, or execs that do not require terminal interaction.

Running an exec in the background is the same as running a CLIST in the background. The program IKJEFT01 sets up a TSO/E environment from which you can invoke execs and CLISTs and issue TSO/E commands. For example, to run an exec named SETUP contained in a partitioned data set USERID.MYREXX.EXEC, submit the following JCL.

Example of JCL to Run an Exec in the Background

//USERIDA   JOB  'ACCOUNT,DEPT,BLDG','PROGRAMMER NAME',
// CLASS=J,MSGCLASS=C,MSGLEVEL=(1,1)
//*
//TMP       EXEC PGM=IKJEFT01,DYNAMNBR=30,REGION=4096K
//SYSEXEC   DD   DSN=USERID.MYREXX.EXEC,DISP=SHR
//SYSTSPRT  DD   SYSOUT=A
//SYSTSIN   DD   *
 %SETUP
/*
//

The EXEC statement defines the program as IKJEFT01. In a DD statement, you can assign one or more PDSs to the SYSEXEC or SYSPROC system file. The SYSTSPRT DD allows you to print output to a specified data set or a SYSOUT class. In the input stream, after the SYSTSIN DD, you can issue TSO/E commands and invoke execs and CLISTs.

The preceding example must be written in a fixed block, 80 byte record data set. To start the background job, issue the SUBMIT command followed by the data set name, for example, REXX.JCL.
SUBMIT rexx.jcl

For more information about running jobs in the background, see z/OS TSO/E User's Guide.