Mainframe Path Start learning free
CoreJcl

A daily job using a generation data group

How a job that runs every night produces a new output without changing its JCL.

DAILYRUN
//DAILYRUN JOB (ACCT01),'DAILY POST',CLASS=A,MSGCLASS=X
//POST     EXEC PGM=PAYPOST
//STEPLIB  DD DSN=PROD.PAY.LOADLIB,DISP=SHR
//* yesterday's output is today's input
//PRIOR    DD DSN=PROD.PAY.BAL(0),DISP=SHR
//TRANS    DD DSN=PROD.PAY.TRANS.D&LYYMMDD,DISP=SHR
//* today's output is a NEW generation
//NEWBAL   DD DSN=PROD.PAY.BAL(+1),DISP=(NEW,CATLG,DELETE),
//            SPACE=(CYL,(100,20),RLSE)
//SYSOUT   DD SYSOUT=*
//*
//* a later step still refers to it as (+1), NOT (0)
//REPORT   EXEC PGM=PAYRPT,COND=(0,LT,POST)
//INFILE   DD DSN=PROD.PAY.BAL(+1),DISP=SHR
//REPORT   DD SYSOUT=*

Stuck on something else?
Ask the community or search the full course.

Ask a question