Menu
CoddyTech

The Nightly Batch

Part of the Batch Jobs with JCL section of Coddy's COBOL Programming journey. Lesson 18 of 19.

challenge icon

Challenge

Easy

On a bad night VALID ends with 8, and the sort and report must not run. Put SORT and PRINT under an IF that is true when VALID ended with 4 or less, and in its ELSE add step ALERT running ALERT with a SYSOUT DD.

Try it yourself

//NIGHTLY  JOB (ACCT),'CODDY',CLASS=A,MSGCLASS=X
//VALID    EXEC PGM=VALIDATE
//ACCTIN   DD DSN=CODDY.ACCT.DAILY,DISP=SHR
//GOODOUT  DD DSN=&&GOOD,DISP=(NEW,PASS)
//SYSOUT   DD SYSOUT=*
//SORT     EXEC PGM=SORTACCT
//SORTIN   DD DSN=&&GOOD,DISP=(OLD,DELETE)
//SORTOUT  DD DSN=&&SORTED,DISP=(NEW,PASS)
//SYSOUT   DD SYSOUT=*
//PRINT    EXEC PGM=PRINTRPT
//RPTIN    DD DSN=&&SORTED,DISP=(OLD,DELETE)
//RPTOUT   DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//* Add the IF, ELSE with step ALERT, and ENDIF

All lessons in Batch Jobs with JCL

Practice on your own: Online COBOL compiler