z/OS ISPF Software Configuration and Library Manager Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Conditional execution

z/OS ISPF Software Configuration and Library Manager Guide and Reference
SC19-3625-00

In Figure 1, program XYZ runs only if the return code from program ABC is less than five.

Figure 1. JCL: Conditional Execution
//STEP1     EXEC    PGM=ABC
//STEP2     EXEC    PGM=XYZ,COND=(4,LT)

In SCLM, the GOODRC parameter on the FLMTRNSL macro allows you to specify return code values for conditional execution. In Figure 2, the GOODRC parameter for program ABC is set to 4. If ABC ends with a return code greater than four, processing ends; program XYZ will not execute.

Figure 2. SCLM Language Definition: Conditional Execution
FLMTRNSL   COMPILE=ABC,FUNCTN=BUILD,PORDER=0,GOODRC=4
FLMTRNSL   COMPILE=XYZ,FUNCTN=BUILD,PORDER=0

In Figure 3, program XYZ runs only if the return code from program ABC is less than 5. Program MBS is to execute after program XYZ regardless of the previous return codes.

Figure 3. JCL: Complex Conditional Execution
//STEP1     EXEC    PGM=ABC
//STEP2     EXEC    PGM=XYZ,COND=(4,LT)
//STEP3     EXEC    PGM=MBS

In SCLM, the GOODRC parameter on the FLMTRNSL macro specifies when to skip all remaining translators in the language definition. To skip selected translators, the FLMTCOND macro can be used. In Figure 4 the FLMTCOND macro specifies that execution may skip program XYZ but continue with program MBS.

Figure 4. SCLM Language Definition: Complex Conditional Execution
FLMTRNSL   COMPILE=ABC,FUNCTN=BUILD,PORDER=0
FLMTRNSL   COMPILE=XYZ,FUNCTN=BUILD,PORDER=0
  FLMTCOND ACTION=SKIP,WHEN=(*,GE,5)
FLMTRNSL   COMPILE=MBS,FUNCTN=BUILD,PORDER=0

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014