1) Executing a query through a JCL //SZ202R EXEC PGM=IKJEFT01,REGION=4M //SYSOUT DD SYSOUT=*,DEST=%%CONTROLM //S...
//SZ202R EXEC PGM=IKJEFT01,REGION=4M
//SYSOUT DD SYSOUT=*,DEST=%%CONTROLM
//SYSPRINT DD SYSOUT=*,DEST=%%CONTROLM
//SYSTSPRT DD SYSOUT=*,DEST=%%CONTROLM
//SYSUDUMP DD SYSOUT=P
//SYSTSIN DD *
DSN SYSTEM(%%DB2SYS)
RUN PROGRAM(DSNTIAD) PLAN(DSNTIAD) +
LIB('DB2G.PROD.RUNLIB.LOAD')
END
//*
//SYSIN DD *
UPDATE DBSZT.AVAL_TABL SET HOTS_AVAL_F = 'R';
COMMIT;
/*
2) JCL for running the DB2 Program
//SZ200 EXEC PGM=IKJEFT01,REGION=4M
//SZCNTRL DD DSN=SZ00.SYS.CONTROL,DISP=SHR
//SZLNMST DD DSN=SZ00.LOAN.MASTER,DISP=SHR
//SZFEES DD DSN=SZ.SZ00.FEES,DISP=SHR
//SORTWK01 DD SPACE=(CYL,(70,10),RLSE)
//SYSOUT DD SYSOUT=*,DEST=%%CONTROLM
//SYSUDUMP DD SYSOUT=P
//SYSTSPRT DD SYSOUT=P
//SYSTSIN DD *
DSN SYSTEM(%%DB2SYS)
RUN PROGRAM(SZ200) PLAN(%%DB2PLN)
END
/*
3) THIS STEP WILL CAUSE THE JOB TO WAIT FOR A SPECIFIED INTERVAL
//PAUSE EXEC CTMRKSLD
LABEL PAUSE
PAUSE 30000
END
//SZ202N EXEC PGM=IKJEFT01,REGION=4M
//SYSTSIN DD *
DSN SYSTEM(%%DB2SYS)
RUN PROGRAM(DSNTIAD) PLAN(DSNTIAD) +
LIB('DB2G.PROD.RUNLIB.LOAD')
END
//*
//SYSIN DD *
UPDATE DBSZT.AVAL_TABL SET HOTS_AVAL_F = 'N';
COMMIT;
/*
4) SORT JCL
//SZ04SR1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=SZ.SZ02.HL.GOOD.ITEM,DISP=OLD
//SORTOF01 DD DSN=SZ.SZ04SR1.GOOD.ITEM1,DISP=(,CATLG),
// UNIT=%%SYSWRK,SPACE=(CYL,(5,5),RLSE)
//SORTOF02 DD DSN=SZ.SZ04SR1.GOOD.ITEM2,DISP=(,CATLG),
// UNIT=%%SYSWRK,SPACE=(CYL,(5,5),RLSE)
//SORTOF03 DD DSN=SZ.SZ04SR1.GOOD.ITEM3,DISP=(,CATLG),
// UNIT=%%SYSWRK,SPACE=(CYL,(5,5),RLSE)
//SYSIN DD *
SORT FIELDS=(1,5,A,8,5,A,6,2,A,13,4,A),FORMAT=BI
OUTFIL FILES=01,INCLUDE=(6,2,PD,GE,100,AND,6,2,PD,LE,199)
OUTFIL FILES=02,INCLUDE=(6,2,PD,GE,200,AND,6,2,PD,LE,299)
OUTFIL FILES=03,INCLUDE=(6,2,PD,LT,100,OR,6,2,PD,GE,300)
//*
5) JCL with COPY INCLUDE
//SZ04SR2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=SZ.SZ04SR1.GOOD.ITEM1,DISP=(OLD,DELETE)
//SORTOF01 DD DSN=SZ.SZ04SR1.GOOD.ITEM4,DISP=(,CATLG),
// UNIT=%%SYSWRK,SPACE=(CYL,(5,5),RLSE)
//SORTOF02 DD DSN=SZ.SZ04SR1.GOOD.ITEM5,DISP=(,CATLG),
// UNIT=%%SYSWRK,SPACE=(CYL,(5,5),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(6,2,PD,EQ,150,OR,6,2,PD,EQ,159)
OUTFIL FILES=02,INCLUDE=(6,2,PD,NE,150,AND,6,2,PD,NE,159)
//*
6) JCL for MERGE:
//SZ04MR1 EXEC PGM=SORT
//SORTIN01 DD DSN=SZ.SZ04SR1.GOOD.ITEM3,DISP=(OLD,DELETE)
//SORTIN02 DD DSN=SZ.SZ04SR1.GOOD.ITEM5,DISP=(OLD,DELETE)
//SORTIN03 DD DSN=SZ.SZ04SR1.GOOD.ITEM2,DISP=(OLD,DELETE)
//SORTOUT DD DSN=SZ.SZ04SR1.GOOD.ITEM6,DISP=(,CATLG),
// UNIT=%%SYSWRK,SPACE=(CYL,(5,5),RLSE)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
MERGE FIELDS=(1,5,A,8,5,A),FORMAT=BI
OPTION EQUALS
//*
2 comments
Nice article..
Check out http://mframes.blogspot.com/
for mainframe blogs
The re i s a progra m ‘ RPT0 1 ’ t ha t c re a t e s re port ‘ Top 5 Drugs of t he Mont h’ for a Pha rma c y c ompa ny .
The re a re 5 st ore s a nd t he sa l e s fi l e from e a c h of t he se st ore s a v a i l a bl e i s a we e k l y fi l e . Thi s progra m
shoul d re a d a l l t he we e k l y fi l e s of e a c h st ore t o c re a t e t he re port . Wri t e a JCL for t he a bov e
re qui reme nt . The Out put fi l e shoul d be a Phy si c a l S e que nt i a l Fi l e wi t h re c ord l e ngt h 1 2 0 by t e s. Thi s
j ob runs on t he 1 st sa t of e v e ry mont h a nd t he da t e shoul d be pa sse d from t he JCL
Cl ue : Shoul d use Conc a t e na t e d da t a se t s & PARm.
how to write this in JCL.please explain
Post a Comment