Download presentation
Presentation is loading. Please wait.
Published byElaine Nichols Modified over 9 years ago
2
Stephen Linkin Houston Community College 1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM 1 The Basics Of Job Control Language Chapter 4
3
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM2 Objectives Applied Objectives Code A Valid JOB Statement Code An EXEC Statement Invoke A Program And Pass A Parameter Code A DD Statement For DASD Data Sets: A. E xisting Cataloged Data Set B. E xisting Uncataloged Data Set C. N ew Non-VSAM Data Set Code JCL And Data For Instream Data Set A. T he Data May Or May Not Include JCL Statements. Code DD Statement For A SYSOUT Data Set. Given Specifications Code JCL.
4
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM3 Knowledge Objectives Basic Format Of JCL Statements Rules Followed Coding Names In Name Field Distinguish Positional And Keyword Parameters How to code subparameters. Continue JCL statements on additional lines. How to code comments The purpose of the DISP parameter The purposes of UNIT, VOLUME, and SPACE parameters Purpose of the DCB parameter in a DD statement. Objectives (2)
5
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM4 Common JCL Statements JOBIdentifies A Job, Defines The Environment, Supplies Accounting Information EXECIdentifies Job Step Of Program Executed DDIdentify Data Set Allocated For Job Step delimiter (/*)End Of An Instream Data Set null (//)End Of A Job (EOJ) comment (//*)Line To Provide Comments
6
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM5 Additional JCL Statements OUTPUTOptions For SYSOUT Processing PROCStart A Procedure PENDEnd A Procedure JCLLIBIdentify Private Procedure Library INCLUDECopy Statements From Another Library Member Into The Job. SETSet Values For Symbolic Variables IF/THEN/ELSE/ENDIF Conditional Execution Of Job Step. COMMANDMVS or JES command issued when the job runs.
7
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM6 A Multi-Step Job Job steps //MM01A JOB 36512 //STEP1 EXEC PGM=PROGA //FILEA DD DSNAME=MM01.CUSTOMER.MASTER,DISP=SHR //FILEB DD DSNAME=MM01.CUSTOMER.LIST,DISP=(NEW,KEEP) //STEP2 EXEC PGM=PROGB //FILEB DD DSNAME=MM01.CUSTOMER.LIST,DISP=(OLD,DELETE) //FILEC DD DSNAME=MM01.CUSTOMER.INVOICE,DISP=SHR //REPORTA DD SYSOUT=* //
8
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM7 The Basic Format For JCL Statements Basic Command Syntax identifier [name] [operation] [parameters] [comments] //MM01A JOB 36512,'R. MENENDEZ',NOTIFY=MM01 //POST EXEC PGM=CM3000 //CUSTTRAN DD DSNAME=MM01.CUSTOMER.TRANS,DISP=SHR //CUSTMAST DD DSNAME=MM01.CUSTOMER.MASTER,DISP=SHR //TRANJRNL DD SYSOUT=* //ERRLIST DD SYSOUT=* // Identifier field Name field Operation field Parameters fields
9
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM8 Positional vs. Keyword Positional parameters Positional parameters //MM01A JOB 36512,'R MENENDEZ‘ //MM01A JOB,'R MENENDEZ' Keyword parameters Keyword parameters //CUSTMAST DD DSNAME=MM01.CUSTOMER.MASTER,DISP=SHR Keyword and positional parameter combinations Keyword and positional parameter combinations //CUSTMAST DD DSNAME=MM01.CUSTOMER.MASTER,DISP=(,CATLG,DELETE ), //UNIT=SYSDA,VOL=SER=MPS800, //SPACE=(CYL,(10,5,2)), //DCB=DSORG=PO //DUNNING DD DSNAME=MM01.DUNNING.FILE,DISP=(NEW,KEEP), //UNIT=SYSDA,VOL=SER=MPS800, //SPACE=(CYL,(1,1)), //DCB=(DSORG=PS,RECFM=FB,LRECL=400)
10
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM9 Long Command Lines Code as many parameters on one line as possible //DUNNING DD DSNAME=MM01.DUNNING.FILE,DISP=(NEW,KEEP),UNIT=SYSDA,| // VOL=SER=MPS800,SPACE=(CYL,(1,1)),DCB=(DSORG=PS,RECFM=FB,LRECL=400) Code only one or two parameters per line //DUNNING DD DSNAME=MM01.DUNNING.FILE,DISP=(NEW,KEEP), // UNIT=SYSDA,VOL=SER=MPS800, // SPACE=(CYL,(1,1)), // DCB=(DSORG=PS,RECFM=FB,LRECL=400)
11
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM10 Ways To Code Comments In JCL The comments field of a JCL statement //MM01A JOB 36512,MENENDEZ,NOTIFY=MM01 //POST EXEC PGM=CM3000 **Post cust transactions** //CUSTTRAN DD DSNAME=MM01.CUSTOMER.TRANS,DISP=SHR //CUSTMAST DD DSNAME=MM01.CUSTOMER.MASTER,DISP=SHR //TRANJRNL DD SYSOUT=* The JCL comment statement //MM01RP JOB 36512,'A PRINCE',MSGCLASS=X,MSGLEVEL=(1,1) //********************************************************* //* Prepare past-due reports from DUNNING file * //********************************************************* //AR7200 EXEC PGM=AR7200 //DUNNING DD DSNAME=MM01.DUNNING.FILE,DISP=OLD, // UNIT=SYSDA,VOL=SER=MPS800 //ATB DD SYSOUT=* //OVERDUE DD SYSOUT=*
12
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM11 The Syntax Of JOB Statement //jobname JOB [ accounting-information ] [,programmer-name ] [,MSGCLASS=class ] [,MSGLEVEL=(stmt,msg) ] [,NOTIFY=user-id ] JOB statement examples //PAY40B1 JOB MMA2AB14 //PAY40B2 JOB (MMA-001,'06/11/02',206),MENENDEZ,MSGCLASS=A //PAY40B3 JOB,MENENDEZ,MSGCLASS=A //PAY40B4 JOB MSGCLASS=A,MSGLEVEL=(0,0),NOTIFY=MM01 A member named JOBCARD that contains a generic JOB statement //MM01XXXX JOB 36512,'R MENENDEZ', // MSGCLASS=X,MSGLEVEL=(1,1),NOTIFY=MM01
13
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM12 Job Names Valid job names //MM01A //CS0166PR //$PSP06B Invalid job names // MM01CDoesn’t start in column 3 //(ABCDE)Starts with an invalid character //PR_001Contains an invalid character //PAYMENT805Contains more than 8 characters
14
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM13 Sample JOB Statements Five JOB statements that use the programmer name parameter //MM01A JOB 36512,RMENENDEZ //MM01B JOB,R.MENENDEZ //MM01C JOB,'R MENENDEZ' //MM01D JOB 36512,'O''Brien' //MM01E JOB,DEPT-10 Two ways to code the NOTIFY parameter //MM01A JOB 36512,LOWE,NOTIFY=MM01 //MM01B JOB 36512,LOWE,NOTIFY=&SYSUID The message returned to your TSO/E terminal when the job completes 17.35.12 JOB02169 $HASP165 MM01B ENDED AT DDC1NJE MAXCC=0 CN(INTERNAL) ***
15
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM14 MSG Class The syntax of the MSGCLASS parameter MSGCLASS=class The syntax of the MSGLEVEL parameter MSGLEVEL=(stmt,msg) Typical JOB statement with both parameters //MM01A JOB 36512,'R MENENDEZ',MSGCLASS=X,MSGLEVEL=(0,0) stmt stmtA single digit specifying which statements should print. 0Print only the JOB statement. 1Print only JCL statements. 2Print only JCL statements submitted through the input stream. msg msgA single digit that specifying which system messages should print. 0Print step completion messages only. 1Print all messages (the default).
16
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM15 The Syntax Of EXEC Statement The syntax of the EXEC statement //stepname EXEC PGM=program-name [,PARM=information ] PGM PGMSpecifies the name of the program to be executed for this job step. PARM PARMOptional; specifies information that’s passed to the program.
17
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM16 Examples of the EXEC statement An EXEC that executes program PAY5B10 in step PAYLIST //PAYLIST EXEC PGM=PAY5B10 An EXEC that passes a parameter value of LINECT=0050 to program IEBDG //DATAGEN EXEC PGM=IEBDG,PARM='LINECT=0050' An EXEC statement passing three parameters to program HEWL //LINKED EXEC PGM=HEWL,PARM='LET,MAP,XREF'
18
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM17 Syntax Of DD Statement For DASD Data Sets The syntax for DASD data sets //ddname DD DSNAME=data-set-name, // DISP=(status,normal-disp,abnormal-disp) // [,UNIT=unit ] // [,VOL=SER=serial-number ] // [,SPACE=unit,(primary-qty,secondary-qty,dir) ] // [,DCB=(option,option...) ] Examples of the DD statement A DD statement that allocates an existing data set //INVMAST DD DSNAME=MM01.INVNTORY.MASTER,DISP=SHR A DD statement that allocates a new data set //INVMAST DD DSNAME=MM01.ACCOUNT.MASTER,DISP=(NEW,CATLG), // UNIT=SYSDA,VOL=SER=MPS8BV, // SPACE=(CYL,(10,2)), // DCB=(DSORG=PS,RECFM=FB,LRECL=100)
19
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM18 Syntax Of DSNAME Parameter {DSNAME} = {data-set-name} {DSN}= {data-set-name(member)} A DD statement that accesses a sequential data set //INVMAST DD DSNAME=MM01.INVMAST.DATA,DISP=SHR A DD statement that accesses a PDS member //INVTRAN DD DSN=MM01.INV.DATA(TRANS),DISP=SHR
20
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM19 Device Parameters The syntax of the UNIT parameter {group-name} UNIT= {device-type} {device-number} The syntax of the VOLUME parameter {VOLUME=}SER=serial-number {VOL=} A DD statement using the UNIT and VOLUME parameters //INVMAST DD DSNAME=MM01.INVNTORY.MASTER,DISP=(NEW,CATLG), // UNIT=SYSDA,VOL=SER=MPS8BV,...
21
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM20 SPACE Parameter The syntax of the SPACE parameter SPACE= (unit,(primary-qty,secondary-qty[,dir])) TRKAllocates space in tracks. CYLAllocates space in cylinders. blklgthAllocates space in blocks, with the block size given in bytes. reclgthAllocates space based on the average record length in bytes. primary-qtyNumber of units to be initially allocated to the file. secondary-qtyNumber of units to be allocated to each secondary extent. dirNumber of directory blocks to allocate for a partitioned data set Examples of the SPACE parameter Example 1 SPACE=(CYL,(4,1,5)) Primary:4 cylinders Secondary:1 cylinder Directory:5 blocks Example 2 SPACE=(TRK,(5,2)) Primary:5 tracks Secondary:2 tracks Example 3 SPACE=(800,(500,100)) Primary:500 800 byte blocks Secondary:100 800 byte blocks
22
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM21 DCB Parameter The syntax of the DCB parameter DCB=(option,option...) Examples of the DCB parameter A DCB parameter for a sequential file with fixed-length records of 133 bytes DCB=(DSORG=PS,RECFM=F,LRECL=133) DD parameters for a file with variable-length records up to 500 bytes long RECFM=VB,LRECL=500 DSORG=xSpecifies the data set’s organization, as follows: PSPhysical sequentialPOPartitioned DADirectISIndexed sequential RECFM=xSpecifies the format of the file’s records, as follows: FFixed length, unblockedFBFixed length, blocked VVariable length, unblockedVBVariable length, blocked VBSVariable length, blocked, spanned UUndefined LRECL=nSpecifies the length of the file’s records. BLKSIZE=nSpecifies the length of the file’s blocks; for FB, BLKSIZE is normally a multiple of LRECL.
23
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM22 DD For instream Data Sets Syntax of the DD statement for instream data sets //ddname DD {*} [,DLM=xx ] {DATA} [/*]
24
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM23 Figure 4-18a Book Example System flowchart for the transaction-posting application
25
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM24 Name Associations Data set requirements for the transaction-posting application ddnameData Set Name CUSTTRANMM01.CUSTOMER.TRANS CUSTMASTMM01.CUSTOMER.MASTER ERRTRANMM01.CUSTOMER.TRANS.ERRS TRANJRNL(SYSOUT data set) TRANSUM(SYSOUT data set) ERRLIST(SYSOUT data set)
26
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM25 Figure 4-18c JCL For Transaction-Posting Application //MM01PT JOB 36512,'M MURACH',MSGCLASS=A,MSGLEVEL=(1,1), // NOTIFY=MM02 //POST EXEC PGM=CM3000 //CUSTTRAN DD DSNAME=MM01.CUSTOMER.TRANS,DISP=SHR //CUSTMAST DD DSNAME=MM01.CUSTOMER.MASTER,DISP=SHR //ERRTRAN DD DSNAME=MM01.CUSTOMER.TRANS.ERRS,DISP=SHR //TRANJRNL DD SYSOUT=* //TRANSUM DD SYSOUT=* //ERRLIST DD SYSOUT=*
27
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM26 Figure 4-19a Multiple Program Application Job Control Requirements For A Report-Preparation Application
28
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM27 Name Associations Data set requirements for programs invoked by report-preparation application StepProgddnameData set name SORT1SORTSYSOUT(SYSOUT data set) SORTINMM01.ACCOUNT.MASTER SORTOUTMM01.ACCOUNT.MASTER.SORT SORTWK01(temporary work file) SYSIN(instream data set) AR7100AR7100ARSORTMM01.ACCOUNT.MASTER.SORT CUSTMASTMM01.CUSTOMER.MASTER DUNNINGMM01.DUNNING.FILE AR7200AR7200DUNNINGMM01.DUNNING.FILE ATB(SYSOUT data set) OVERDUE(SYSOUT data set)
29
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM28 (continued) Step ProgramddnameData set name SORT2SORTSYSOUT(SYSOUT data set) SORTINMM01.DUNNING.FILE SORTOUTMM01.DUNNING.FILE.SORT SORTWK01(temporary work file) SYSIN(instream data set) AR7300 AR7300DUNSORTMM01.DUNNING.FILE.SORT XREF(SYSOUT data set) STMTS(SYSOUT data set
30
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM29 The JCL for report-preparation application 1//MM01RP JOB 36512,'A PRINCE',MSGCLASS=X,MSGLEVEL=(1,1), // NOTIFY=MM03 2//SORT1 EXEC PGM=SORT 3//SYSOUT DD SYSOUT=* 4//SORTIN DD DSNAME=MM01.ACCOUNT.MASTER,DISP=SHR 5//SORTOUT DD DSNAME=MM01.ACCOUNT.MASTER.SORT,DISP=(NEW,KEEP), // UNIT=SYSDA,VOL=SER=MPS800, // SPACE=(CYL,(1,1)), // DCB=(DSORG=PS,RECFM=FB,LRECL=400) 6//SORTWK01 DD UNIT=SYSDA,VOL=SER=MPS800, // SPACE=(CYL,(1,1)) 7//SYSIN DD * SORT FIELDS=(16,5,CH,A,1,5,CH,A) /* 8//AR7100 EXEC PGM=AR7100 9//ARSORT DD DSNAME=MM01.ACCOUNT.MASTER.SORT,DISP=(OLD,DELETE), // UNIT=SYSDA,VOL=SER=MPS800 10//CUSTMAST DD DSNAME=MM01.CUSTOMER.MASTER,DISP=SHR 11//DUNNING DD DSNAME=MM01.DUNNING.FILE,DISP=(NEW,KEEP), // UNIT=SYSDA,VOL=SER=MPS800, // SPACE=(CYL,(1,1)), // DCB=(DSORG=PS,RECFM=FB,LRECL=400)
31
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM30 (continued) 12//AR7200 EXEC PGM=AR7200 13//DUNNING DD DSNAME=MM01.DUNNING.FILE,DISP=OLD, // UNIT=SYSDA,VOL=SER=MPS800 14//ATB DD SYSOUT=* //OVERDUE DD SYSOUT=* //SORT2 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD DSNAME=MM01.DUNNING.FILE,DISP=(OLD,DELETE), // UNIT=SYSDA,VOL=SER=MPS800, //SORTOUT DD DSNAME=MM01.DUNNING.FILE.SORT,DISP=(NEW,KEEP), // UNIT=SYSDA.VOL=SER=MPS800, // SPACE=(CYL,(1,1)) // DCB=(DSORG=PS,RECFM=FB,LRECL=400) //SORTWK01 DD UNIT=SYSDA,VOL=SER=MPS800, // SPACE=(CYL,(1,1)) //SYSIN DD * SORT FIELDS=(43,2,CH,A,1,5,CH,A,50,5,CH,A) /* //AR7300 EXEC PGM=AR7300 //DUNSORT DD DSNAME=MM01.DUNNING.FILE.SORT,DISP=(OLD,DELETE), // UNIT=SYSDA,VOL=SER=MPS800 //XREF DD SYSOUT=* //STMTS DD SYSOUT=*
32
1/26/2007 © 2002 - Mike Murach & Associates, 2007 - HCC, IBM31 End Presentation
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.