1 / 43

JCL

JCL. Day 2. Agenda for Day 2. DD statement Syntax Parameters Procedures Types Symbolic Parameters Examples IBM Utility programs Definition and use Examples. DD STATEMENTS. ddname DD * VOL DATA DCB SYSOUT DSN DUMMY UNIT DLM

talor
Télécharger la présentation

JCL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. JCL Day 2

  2. Agenda for Day 2 • DD statement • Syntax • Parameters • Procedures • Types • Symbolic Parameters • Examples • IBM Utility programs • Definition and use • Examples

  3. DD STATEMENTS ddname DD * VOL DATA DCB SYSOUT DSN DUMMY UNIT DLM DISP SYSUDUMP SYSMDUMP SYSABEND REFERBACK JOBLIB STEPLIB

  4. DSN • The name of the data set Simple Name : 1 to 8 chars Qualified Name : separated by periods each name 1 to 8 chars total 44 characters including periods Temporary data sets : &&TEMP or do not mention DSN parameter Refer back : DSN=*.STEP1.DD1

  5. DISP NEW , CATLG , DELETE OLD , KEEP , KEEP DISP= SHR , UNCATLG , CATLG MOD , DELETE , UNCATLG PASS , DISP=(status,normal-disposition,abnormal-disposition)

  6. DCB LRECL=n (VALUE IN BYTES) RECFM=(F/FB/V/VB/U) BLKSIZE= multiple of LRECL DSORG=(PS/PO/DA)

  7. SPACE SPACE=(space units,(primary,secondary,dir),RLSE) space unit - TRK(tracks)/CYL(cylinders)/BLOCKSIZE in bytes EX: SPACE=(TRK,(100,200)) SPACE=(TRK,(10,5)) - allocate 10 tracks primarily and if required as secondary allocation 5 tracks

  8. UNIT Hardware address Type Group // UNIT=0320 OR // UNIT=3390 OR // UNIT=SYSDA OR // UNIT=DISK To use the same unit that has been used by prior DD statement // UNIT=AFF=ddname

  9. VOL It is used to specify a disk volume or specific tapes. // VOL=SER=INUSR2,UNIT=SYSDA To referback a volume used by some prior DD statement use: // VOL=REF=ddname

  10. SYSOUT // DDNAME DD SYSOUT=CLASS SYSOUT is used to route output to a device. // DDNAME DD SYSOUT=A If you want to send the output to the same device described by MSGCLASS of the job use: // DDNAME DD SYSOUT=*

  11. JOBLIB STATEMENTS EX //ER5077A JOB ,,CLASS=A //JOBLIB DD DSN=OPERN.CICS3.LOADLIB, // DISP = (what should be the disposition) // DISP = SHR //STEP1 EXEC PGM=INHOUSE The JOBLIB statement specifies the library (PDS) where the program isresiding. It is placed after the JOB statement and is effective for every JOB steps.

  12. STEPLIB STATEMENTS EX. //STEP1 EXEC PGM=INHOUSE //STEPLIB DD DSN=OPERN.CICS3.LOADLIB, // DISP = (what should be the disposition) // DISP = SHR The STEPLIB statement defines the library where the program isresiding. It is placed after the EXEC statement and is effective for that particular step and overrides any JOBLIB statement.

  13. The first JCL to create a PS. //ER5077J JOB 1234,ABC,CLASS=A, // MSGCLASS=(1,1) TO CREATE PS //STEP1 EXEC PGM=IEFBR14 //PS1 DD DSN=ER5077.OUTPUT.PSFILE, // UNIT=SYSDA, // VOL=SER=INUSR2, // DCB=(LRECL=80,RECFM=FB,BLKSIZE=800), // SPACE=(TRK,(1,1)),DISP=(NEW,CATLG)

  14. Review Questions • The positional parameters for an EXEC statement are PGM & PROC • COND Permits the execution of steps to depend on the return code from the Previous Steps • JOBLIB represents the collection of jobs ? False. Represents library for USER programs • JCL has JOBLIB. Step1 has STEPLIB statement. For Step2 the program would be searched in JOBLIB/STEPLIB library? JOBLIB. STEPLIB is valid for only Step1

  15. Review Questions …. • For the following JCL will Step 2 get executed? //ER5077J JOB ,,NOTIFY=&SYSUID, COND=(4,LT) //STEP1 EXEC PGM=IEFBR14 //STEP2 EXEC PGM=IEFBR14,COND=(0,NE,STEP1) Yes. Step2 would be executed. • If COND parameter is mentioned in JOB & EXEC statement then what happens? COND mentioned in the JOB statement is evaluated first & then the COND mentioned in the EXEC statement

  16. PROCEDURES • It is a prepacked JCL • A JCL needed by many different users • A JCL executed on a repetitive basis • A JCL often repeated within the execution of a single job

  17. TYPE OF PROCEDURES • In-stream procedures • Coded in the executing job • Max of 15 per JOB • Catalogued Procedure • Member of a PDS (procedure library) • Max 255 steps

  18. Invoking a Procedure // EXEC procname // EXEC PROC=procname EX: //name1 EXEC MYPROC //name1 EXEC PROC=MYPROC

  19. PROCEDURES must not contain : • 1) JOB statement 2) JOBLIB DD statement • 3) DD * , DD DATA - In-stream data • 4) /* delimiter statement • 5) // Null statement • 6) JES statements • 7) PEND statement (for cataloged procedures)

  20. In-stream procedure • It must begin with a PROC statement and end with a PEND statement • It should be coded before the first EXEC statement invoking the instream procedure //ER5077J JOB ,,CLASS=A //PROC1 PROC //STEP2 EXEC PGM=IEFBR14 //DD1 DD DSN=&&TEMP,SPACE=(TRK,(1,1)), // DCB=(RECFM=FB,BLKSIZE=800,LRECL=80), // DISP=(NEW,KEEP),UNIT=SYSDA // PEND //STEP1 EXEC PROC1 //

  21. CATALOGED PROCEDURE • It must be a member of PDS • PEND statement is not mandatory • It can have a maximum of 255 steps • The name of the library (PDS) should be specified if cataloged library is not in the system defined library (SYS1.PROCLIB) using JES JOBPARM statement or JCLLIB statement

  22. JCLLIB Specifies the names of the private libraries the system has to search for: a) Procedures named on any EXEC statement b) JCL referenced by the INCLUDE statement (after release 4) ex: // INCLUDE MEMBER=MYJCL The JCLLIB statement must be placed before the first EXEC statement in the job // JCLLIB ORDER=(library[,library]....) // JCLLIB ORDER=(MYPROC.JCL.PROCLIB, // MYPROC.JCL.PROCLIB1)

  23. Cataloged procedure It must begin with a PROC statement and PEND is optional. It must be cataloged in order to access it that is it must be a member of a PDS. Cataloged procedure : //MYPROC PROC //STEP2 EXEC PGM=IEFBR14 //DD1 DD DSN=&&TEMP,SPACE1(TRK,(1,1)), // DCB=(RECFM=FB,BLKSIZE=800,LRECL=80), // DISP=(NEW,KEEP),UNIT=SYSDA • Cataloged procedure called through a JCL : //ER5077J JOB ,ABC, CLASS=A // JCLLIB ORDER=(ER5077.PROCLIB) //STEP1 EXEC MYPROC

  24. Questions ?? If a JCL has two procedures, an instream procedure first and a cataloged procedure next with the same name, which one will be executed ? //ER5077J JOB ,,NOTIFY=&SYSUID,CLASS=A //JCLLIB ORDER=(ER4857.PROCLIB) //MYPROC PROC //STEP1 EXEC PGM=IEFBR14 //DD1 DD DSN=ER5077.TEST.CAT,SPACE=(TRK,(1,1)), // DCB=(RECFM=FB,BLKSIZE=800,LRECL=80), // DISP=(NEW,DELETE),UNIT=SYSDA // PEND //STEP1 EXEC MYPROC //* Answer : The Instream procedure will be executed

  25. Questions ?? If a JCL has two procedures, a cataloged procedure first and an instream procedure next with the same name which one will be executed ? //ER5077J JOB ,,NOTIFY=&SYSUID,CLASS=A // JCLLIB ORDER=(ER5077.PROCLIB) //STEP1 EXEC MYPROC //MYPROC PROC //STEP1 EXEC PGM=IEFBR14 //DD1 DD DSN=ER5077.TEST.CAT,SPACE=(TRK,(1,1)), // DCB=(RECFM=FB,BLKSIZE=800,LRECL=80), // DISP=(NEW,DELETE),UNIT=SYSDA // PEND //* Answer : Cataloged procedure will be executed

  26. Nested Procedures • Cataloged and In-stream procedure can invoke other procedure ( up to 15 level) • An In-stream procedure cannot be defined within another procedure

  27. Nested Procedures (examples) //ER5077J JOB ,,NOTIFY=ER4857,CLASS=A //LIB1 JCLLIB ORDER=(ER5077.JCL.SOURCE) //FSTPROC PROC //STEP1 EXEC MYPROC // PEND //SNDPROC PROC //STEP1 EXEC FSTPROC // PEND //STEP1 EXEC SNDPROC //* • SNDPROC is called first which calls FSTPROC which initiates cataloged procedure MYPROC

  28. Nested Procedures • NSTPROC //NSTPROC PROC //STEP1 EXEC PGM=IEFBR14 • MYPROC //MYPROC PROC //STEP1 EXEC NESTPROC //STEP2 EXEC PGM=IEFBR14,COND=(0,NE) //DD1 DD DSN=&&TEMP,SPACE=(TRK,(1,1)), // DCB=(RECFM=FB,BLKSIZE=800,LRECL=80), // VOL=SER=INUSR3, // DISP=(NEW,KEEP),UNIT=SYSDA • CALLJCL //ER5077J JOB ,,NOTIFY=&SYSUID,CLASS=A // JCLLIB ORDER=(ER5077.PROCLIB) //STEP1 EXEC MYPROC

  29. Modifying the Procedure SYMBOLIC PARAMETERS OVERRIDING EXEC & DD PARAMETERS

  30. Symbolic Parameters Symbolic parameters are variables used in procedures Syntax - &Varname Varname - 1-7 character Value can be specified at : 1) SET statement 2) EXEC PROC statement 3) PROC statement

  31. Symbolic Parameters examples ... //ER5077J JOB ,,CLASS=A //SET1 SET A=ER5077.PDS.SAMPLE //STEP1 EXEC PGM=IEFBR14 //DD1 DD DSN=&A,SPACE=(TRK,(1,1)), // DCB=(RECFM=FB,BLKSIZE=800,LRECL=80), // DISP=(NEW,DELETE),UNIT=SYSDA

  32. Symbolic Parameters examples ... //ER5077J JOB ,, CLASS=A //MYPROC PROC A=ER5077.PDS.SAMPLE //STEP2 EXEC PGM=IEFBR14 //DD1 DD DSN=&A,SPACE=(TRK,(1,1)), // DCB=(RECFM=FB,BLKSIZE=800,LRECL=80), // DISP=(NEW,DELETE),UNIT=SYSDA // PEND //STEP1 EXEC MYPROC

  33. REFERING BACK //ER5077J JOB ,,NOTIFY=&SYSUID,CLASS=A //STEP1 EXEC PGM=IEFBR14 //DD1 DD DSN=ER5077.TEST.PS1,SPACE=(TRK,(1,1)), // DCB=(RECFM=FB,BLKSIZE=800,LRECL=80), // DISP=(NEW,DELETE),UNIT=SYSDA //DD2 DD DSN=ER5077.TEST.PS2,SPACE=(TRK,(1,1)), // DCB=*.DD1,VOL=SER=INUSR3, // DISP=(NEW,DELETE),UNIT=SYSDA

  34. REFERING BACK //ER5077J JOB ,ABC,NOTIFY=&SYSUID,CLASS=A //STEP1 EXEC PGM=IEFBR14 //DD1 DD DSN=ER5077.TEST.PS1,SPACE=(TRK,(1,1)), // DCB=(RECFM=FB,BLKSIZE=800,LRECL=80), // DISP=(NEW,CATLG),UNIT=SYSDA //STEP2 EXEC PGM=IEFBR14 //DD1 DD DSN=*.STEP1.DD1,SPACE=(TRK,(1,1)), // DCB=*.STEP1.DD1,VOL=SER=INUSR3, // DISP=(OLD,DELETE),UNIT=SYSDA

  35. IBM UTILITY PROGRAMS Provides a variety of useful function like • Copying a member/data set • Listing • Maintaining source libraries etc. MVS provides a number of pre-written utility programs that can be used by analysts, system programmers, and application programmers to assist them in maintaining and organizing data.

  36. SYSTEM UTILITY IEHLIST IEHMOVE IEHINITT IEHPROGM IFHSTATR DATA SET UTILITY IEBGENER IEBCOPY IEBCOMPR IEBPTPCH IEBDG IEBUPDTE IEBMOVE IEBEDIT UTILITY PROGRAMS • IDCAMS • IEFBR14

  37. GENERAL FORMAT FOR IEBXXXX //STEP EXEC PGM=IEBxxxx //SYSPRINT DD(message data set ,no DCB) //SYSIN DD (Control information for utility) //SYSUT1 DD (input data set) //SYSUT2 DD (output dataset)

  38. IEBGENER utility • It is used to copy one sequential file to another. //ER5077J JOB ,ABC,CLASS=A,NOTIFY=&SYSUID //STEP1 EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSUT2 DD DSN=ER5077.IEBGENER.NEWPS, // VOL=SER=INUSR2,SPACE=(TRK,(1,1)), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=800), // DISP=(NEW,CATLG) //SYSUT1 DD DSN=ER5077.INPUT.JCLPS1,DISP=SHR //SYSIN DD DUMMY

  39. IEBCOPY • To copy PDS on to DASD • To copy PDS on to Tapes by converting it to sequential dataset etc //ER5077J JOB ,,CLASS=A,NOTIFY=ER5077 //STEP1 EXEC PGM=IEBCOPY //SYSPRINT DD SYSOUT=A //SYSUT1 DD DSN=ER5077.JCL.SOURCE,DISP=SHR //SYSUT2 DD DSN=ER5077.IEBCOPY.PDS, // VOL=SER=INUSR2,SPACE=(TRK,(5,5,8)), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=800), // DISP=(NEW,CATLG) //SYSIN DD * COPY INDD=SYSUT1,OUTDD=SYSUT2 /*

  40. IEFBR14 • Using IEFBR14 you can create empty data sets or delete data sets Allocate new flat files //ER5077J JOB ,,CLASS=A,NOTIFY=&SYSUID //STEP1 EXEC PGM=IEFBR14, //DD1 DD DSN=ER5077.JCL.PS,DISP=(NEW,CATLG,DELETE), // UNIT=SYSDA, SPACE=(CYL(2,2),RLSE), // DCB=(LRECL=80,BLKSIZE=0,RECFM=FB) //SYSPRINT DD SYSOUT=*

  41. SORT • This can be used to sort, copy, merge data sets • To SORT records in a dataset in ascending/descending order on given field(s) //STEP1 EXEC PGM=SORT //SYSPRINT DD SYSOUT=* //SORTIN DD DSN=input data set,DISP=SHR //SORTOUT DD DSN=output data set, // DISP=(,CATLG), // DCB=*.SORTIN, // SPACE=(CYLS,(10,10),RLSE) //* //************* //* SORT CARD : //************* //SYSIN DD * SORT FIELDS=(1,05,CH,A), //*

  42. Review Questions • Instream procedure could be member of a PDS? NO • A Catalogued procedure can call an Instream procedure? NO • Which type of parameters are used to customize the procedure? Symbolic • Catalogued procedure can invoke other procedures beyond 20 levels? No. Till 15 Levels.

  43. Thank You!

More Related