Top Banner
State Farm Post-IPEP Manual JCL Section (last updated 07/31/00) 1 JCL Job Control Language consists of several job control statements. These statements are created by a programmer or by a JCL coder using documentation provided by a programmer. The specific kinds of information that JCL statements usually provide are: - Which programs to execute - The sequence of program execution - The datasets required by programs There are many other types of information that JCL may provide to specify how the job should be processed, but the minimum requirement is to identify the job, the program to execute in each job step, and the datasets to be used. There are five basic types of JCL statements: - JOB Statement - EXEC Statement - DD Statement - NULL Statement - COMMENT Statement Before the specific JCL statements are described, lets review the concept of a job and its job steps called a job input stream. A job step identifies a single program to be executed and a job is a collection of related job step The following is an example of JCL code. In this section, we will look and describe all parts of this code.
26
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 1

JCLJob Control Language consists of several job control statements. These statements are created bya programmer or by a JCL coder using documentation provided by a programmer. The specifickinds of information that JCL statements usually provide are:

- Which programs to execute- The sequence of program execution- The datasets required by programs

There are many other types of information that JCL may provide to specify how the job should beprocessed, but the minimum requirement is to identify the job, the program to execute in each jobstep, and the datasets to be used. There are five basic types of JCL statements:

- JOB Statement- EXEC Statement- DD Statement- NULL Statement- COMMENT Statement

Before the specific JCL statements are described, let�s review the concept of a job and its jobsteps called a job input stream. A job step identifies a single program to be executed and a job isa collection of related job step

The following is an example of JCL code. In this section, we will look and describe all parts ofthis code.

Page 2: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 2

Job Input Stream

A series of jobs ready to be submitted to the operating system is referred to as the job input stream,job stream, or input stream. The discussion of job input stream is related to the three JCLstatements, and the definitions of job and job steps. Each job step contains dataset descriptionsneeded for the program to be executed. Each job is made up of the following elements:

- A JOB Statement- Job Step(s) marked by EXEC statements- Dataset descriptions that are described by DD statements and needed for each job

step.

Page 3: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 3

JCL Control Statement Fields

Every control statement is logically divided into different fields. There are four fields or types ofinformation.

Here is the general format of a JCL statement:

//NAME OPERATION OPERANDS COMMENTS

- Name Field- Operation Field- Operand Field- Comments Field

All JCL statements begin with a // in columns 1 and 2. The // identifies a statement as a JCLstatement as opposed to a data statement. The name field begins immediately after the secondslash; while the other fields are separated from each other by one or more blanks. The fields,except for comments, must be coded in columns 3-71. The comment field can extend throughcolumn 80.

The JCL statement fields must be coded in the order presented above. One or more blanks mustseparate each field.

Page 4: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 4

The Name Field

The Name Field identifies, or names, the JCL statement so that other statements or the operatingsystem can refer to it. The name field is required on the JOB statement. It can be optional for theEXEC and DD statements, but is usually used. Choose names that are meaningful since they willbe helpful in locating problems later. The following are specifications for JCL statement names:

- They may be 1-8 characters long- Characters may be alphanumeric or national (#,@,$)- No special characters may be used- The first character may be alphabetic or national- The first 4 characters should be your 4-digit primary logon- Names must begin in column 3

Valid Examples of Job Names:

//ABC12//$456//B$JOB1

Invalid Examples for Job Names:

//+JOB1 � printer character must be alphabetic or national//EXAMPLE14 � longer than 8 characters// RUN2 � did not start in column 3

Operation Field

The Operation Field specifies the type of control statement; JOB, EXEC, or DD. In this case it isJOB.

Valid examples of a JOB control statement:

//JOB12 JOB//MYRVN JOB

Invalid examples of a JOB control statement:

//JOB JOB12 � Job must follow the Job name.//RUNS#JOB � Must separate job name from job.

Operand Field

There are many kinds of information that can be provided to the operating system with operandson the job statement. These operands are also referred to as parameters and are either positionalor keyword.

Page 5: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 5

Positional Parameters must be coded in the order shown with a comma separating them. Noblank spaces are allowed between parameters.

Keyword Parameters are �positionally� independent with respect to other keyword parameters;that is, they may be coded in any order. The only restriction is that keyword parameters mustbe coded after positional Parameters. There are many optional keyword parameters, we willdiscuss the most commonly used ones:

If you have any questions about this section, please see your mentor before continuing.

Page 6: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 6

The JOB Statement

The JOB statement identifies a job, (a batch unit of work), to MVS. The job statement names thejob and supplies the necessary information to indicate which resources the job will use. A Job isconsidered to consist of multiple job steps, each step is made up of an EXEC statement and oneor more DD statements. A Job is all the JCL statements between a Job statement and the next Jobstatement or null (*//*) statement.

The parts of the Job Statement are:

Jobname � the name of the job consisting of 1-8 alphanumeric or national characters ($, #, @).The job name starts in column three on the Job Statement and must be present.

** It is recommended that the first 4 characters of a jobname be your 4-character primary logon.In the example above, the Jobname is FXCHN004. The �FXCH� is Connie Huston�s 4-characterprimary logon.

Accounting Information � this is no longer used in the Life Company so a comma is coded as thefirst positional parameter so that the job will not abend.

** The example shows the �,� right after the jobname.

Programmer�s Name � the programmer�s name is a positional parameter that follows theaccounting information on the Job Statement. Life Company includes some output routinginformation in the programmer name parameter. The routing information is included to aid thedistribution of written output to each analyst�s desk.

** The example above shows that programmer�s name is �HUSTON� she is in unit FX mail droptwo on J4.

Keyword Parameters � A variety of keyword parameters can be specified on the Job Statement,these are:

ADDRSPC= BYTES= CARDS= COND= GROUP=LINES= MSGLEVEL= NOTIFY= PAGES= PASSWORD=PERFORM= PRTY= RD= RESTART= SECLABEL=SCHENV= TIME= TYPERUN= USER=

Here are the most commonly used Keyword Parameters:

CLASS= MSGCLASS= NOTIFY= REGION=

** The example above shows all four of the most commonly used keyword parameters listedabove.

Page 7: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 7

Here is the Job Statement�s basic structure://Jobname , programmer�s name, keyword1, keyword2, etc.

CLASS � Use this operand to assign a job class to a job.

REGION � Use this operand to specify the amount of virtual storage space allocated to a job.

NOTIFY � Use this operand to identify who the job response messages should go to.

MSGCLASS � Use this to identify the route of output, JCL statements, and system messages.The most commonly used message classes are 2($AVRS) and A(Print).

The Job Parm

The Job Parm statement is used only in the Life Company because jobs are run in the JES2system.

JOBPARM � Use this operand to identify the system you are running the job on and where theoutput should be routed.

ACTIVITY:1. What are the 3 statements used in JCL?2. What is the positional parameter used in Life Company?3. Edit a new member in your ISPF.JCL name NG157. Code the job statement and job parm

statement for this job.4. Check with your mentor to make sure your JCL is correct because you will be adding to this

member at a later date.

Page 8: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 8

The EXEC Statement

The Execute statement identifies a job step to execute in MVS. This statement follows the JOBstatement and names a program to be executed. Programs are stored in program libraries, andwhen the EXEC statement references them, the programs will be retrieved by the operatingsystem. Some programs have optional parameters that can be listed on the EXEC statement.

A job can have a maximum of 255 job steps. This maximum includes all steps in any proceduresthe EXEC statements call.

The parts of an EXEC statement are:

Stepname � the name of the job step, consisting of 1-8 alphanumeric or national characters andmust be followed by at least one blank . The step name starts in column 3 on the EXECstatement, but does not have to be present.

** NG157P is the stepname in the example above.

Exec � the term EXEC follows the stepname and identifies the JCL statement as an EXECstatement.

** The example above lets the JCL know this is an EXEC step by putting EXEC betweenthe stepname and Program name.

Procname/Program � the name of the catalogued procedure or program to be invoked by the jobstep. The parameter is the only positional parameter in the EXEC statement.

** PGM=PNG157 is the program to execute in the example above.

Keyword Parameters � A variety of keyword parameters can be specified on the EXEC statement,these are:

ADDRSPC= CLASS= DPRTY= DYNAMNBR=PERFORM= PGM=

** TIME=30 is the keyword parameter in the example above.

The following keyword parameters are most commonly used in the EXEC statement:

PARM= The PARM parameter is used to pass variable information to the program beingexecuted in a job step. The processing program must contain instructions toretrieve the information and take advantage of it. PARM values are program-specific; that is, each program expects a different parm or possibly no parm atall. The PARM= keyword is continued onto a second statement by enclosingthe value it specifies in parenthesis, and enclosing any subexpressions withinapostrophes followed by a comma. Begin the continued PARM valueanywhere in columns 4 through 16 on the next

Page 9: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 9

JCL statement with a PARM:Example: //JS10 EXECASMFC,PARM.PS10=(ESD,TERM,NUM,STMT,DECK,OBJECT,

NOMAP,NOLIST,'WORK=NOW')

RD= The RD (Restart Definition) parameter is used to tell MVS that it canautomatically restart a job step if it fails, or prevent the usage of checkpointrestart facilities in the program or on the DD statement (via the CHKPT JCLkeyword).

Syntax: RD{procstepname}={R }{RNC }{NR }{NC }

Where: "R" indicates automatic step restart should be done, "RNC" indicatesthat automatic step restart should be done, but checkpoint restarts should bedeferred, "NR" indicates that automatic step restart can't happen, but deferredcheckpoint restart is allowed, and "NC� indicates that automatic and deferredrestart in any form can't happen

REGION= This is used just like the operand for the job statement, and specifies theregions size for the program you are executing within this job step.Ex. //TEST EXEC PGM=TBIGRUN,REGION=5000K

TIME= Specifies the amount of time this step is expected to run.Ex: //STEP1 EXEC PGM=DB540A, TIME=15,REGION=100K //STEP2 EXEC PGM=DB540B, TIME=10,REGION=500K

COND= The COND parameter is used to specify the return code tests that MVS willperform to see if a job step will be executed or not. Before a job step containinga COND= parameter is executed, MVS performs theCOND parameter test(s) specified against the return codes from all prior jobsteps or the steps named on the COND= parameter. If none of these tests issatisfied, the system executes the job step; if any test is satisfied, the systemskips the job step on which the COND= parameter is coded. Tests are madeagainst return code values for the current execution of the job. A step skippedbecause of an EXEC statement COND parameter will not produce a returncode, because it will not be executed.

Note that skipping a step because of a return code test is not the same asabending the step. The system abends a step following an error that is seriousenough to keep successful execution from occurring. Skipping of a step justkeeps it from being executed.

Here is the EXEC statement basic structure:

//stepname EXEC proc or program, keyword1, keyword2, etc.

Proc (Procedure Name) � Specifies a procedure to be used.Pgm (Program Name) � Names the program to be executed.

The following are examples of EXEC statements:

Page 10: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 10

ACTIVITY:Add an EXEC statement to your ISPF.JCL NG157 member that executes the program PNG157.

Please check with your mentor to make sure that your EXEC statement is correct because you willbe adding additional steps to it in the following sections.

Page 11: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 11

The Data Definition Statement (DD)

Data Definition (DD) statements define the datasets that are required by the program to beexecuted. There must be (at least) one DD statement for each dataset used in the job step;therefore, the number of DD statements that follow an EXEC statement depend on the datasetrequirements of the program. The order of DD statements within a job step is not usuallysignificant. The DD statement is the most extensive of the JCL statements.

Up to 1,635 DD statements can be allocated to a single job step.

The three parts of the DD statement are:

DDNAME � made up of 1-8 alphanumeric or national characters. The ddname starts in column 3on the DD statement and is required on DD statements that are not concatenated to another DDstatement.

** The DDNAME in the example above is �INPUT�

Positional Parameters � a variety of positional parameters can be specified on the DD statement,these are:

DATA DUMMY DYNAM

Keyword Parameters � A variety of keyword parameters can be specified on the DD statement,there are:

ACCODE AMP AVGREC BLKSIZE BURSTCHARS CHKPT CNTL COPIES DATADATACLAS DCB DDNAME DEST DISPDLM DISD DSNAME DSNTYPE DUMMYDYNAM EXPDT FCB FILEDATA FLASHFREE HOLD KEYLEN KEYOFF LABELLIKE LRECL MGMTCLAS MODIFY OUTLIMOUTPUT PATH PATHDISP PATHMODE PATHOPTSPROTECT QNAME RECFM RECORG REFDDRETPD RLS SECMODEL SEGMENT SPACESPIN STORCLAS SUBSYS SYSOUT TERMUCS UNIT VOLUME

** The example above uses the following keyword parameters: TAPE, UNIT, and VOL.

Page 12: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 12

Here is the DD statement�s basic structure:

//ddname DD positional parameter,keyword1, keyword2, etc.

We will use the DD statement below to show examples of different DD statement options.

DD statements may:- Give the dataset name FXCH.TERMIN.D990920.RUS.DATA- Specify record length, blocking, etc. DCB=(LRECL=19069, RECFM=U)- Request I/O devices UNIT=3390- Specify storage allocation SPACE=(TRK,(150,10),RLSE)

We will now discuss some of the most commonly used operand used in the DD statement:

DDNAMEThe DDNAME tells the operating system to look at the JCL for that program and find aDD statement with that DDNAME. The DDNAME has the same rules as all name fields.

DSN or DSNAMEDSNAME is used to identify the data you will be using in your Job step. DSNAME isabbreviated as DSN and will be used as such in the rest of our examples. The firstcharacter of a DSN must be alphabetic or national.

DISPThe DISP parameter identifies the status of a data set prior to the beginning of the jobstepand after the jobstep completes. There are three subparameters:

The first subparameter specifies the status at the beginning of the Job Step.The second subparameter specifies what to do with the file at the end of the step.The third subparameter specifies what to do with the file if an error occurs.

Here are some subparamter descriptions:

First subparamter options:SHR � Allows multiple jobs to access the same data at the same time.NEW � When a dataset is first created, it must be OLD or MOD.MOD � Can be interpreted as either NEW or OLD. Initially the system assumes that thedataset exists and attempts to locate it. If it is not found, MOD is treated as NEW.OLD � Used only for this job. Cannot simultaneously access the dataset with anotherjob.

Second subparameter option:

Page 13: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 13

PASS � Coding PASS makes the dataset available to upcoming steps in the job. Anentry of the dataset will be put in the pass table.

Second and Third subparameter options:KEEP � Is a default for the second and third subparamters. Coding KEEP creates apermanent dataset which exists after a jobstep ends. KEEP will not place an entry intothe catalog or pass table.CATLG � Places an entry of the dataset into the catalog. This entry can be called uponin the next steps or in a different job by the dataset name.UNCATLG � Will rename the datasets entry from a system catalog. UNCATLG doesnot delete the dataset from disk or tape columns. Basically, it will turn the catalogeddataset into a kept dataset. After a dataset or tape is UNCATLG, it can be retrieved.Using a unit or VOL parameter, the data can be retrieved. It can be retrieved only if tapeor disk has not been scratched or cleared.DELETE � DELETE is used to remove a dataset (scratch it) from a column. When atape is deleted, it is available to be written over again.

Here are some Examples of the DISP parameter:

DISP Value Coded Default Values SuppliedDISP=NEW DISP=(NEW,DELETE,DELETE)No DISP parameter coded DISP=(NEW,DELETE,DELETE)DISP=(,PASS) DISP=(NEW,PASS,DELETE)DISP=(,KEEP) DISP=(NEW,KEEP,KEEP)DISP=(OLD,,CATLOG) DISP=(OLD,KEEP,CATLG)DISP=(MOD,,DELETE) DISP=(MOD,KEEP OR DELETE,DELETE)

Page 14: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 14

DISP=MOD DISP=(MOD,KEEP OR, KEEP OR DELETE, DELETEDISP=(,,CATLOG) DISP=(NEW,DELETE,CATLOG)

UNITThe Unit parameter specifies the type of I/O device to a dataset. Notice that codingUNIT=group name does not ordinarily identify a specific volume. Rather, it classifiesthe I/O device associated with the volume.

Examples of the Unit Operand:Group Name Usual MeaningUNIT=SYSDA Any disk drive within a particular group;

SYSDA is often used with temporary or workdatasets; it is unnecessary to code a VOLparameter with UNIT=SYSDA.

UNIT=DASD Same meaning as UNIT=SYSDAUNIT=DISK Same meaning as

UNIT=SYSDA;SYSDA,DASD, and DISK canall be used to identify different groups of diskdevices.

UNIT=TAPE Any tape drive.UNIT=WORK A disk drive used to hold work datasets.

VOLUMEWhen using Volume, the abbreviated version is VOL. VOL has two subparameters, SERand REF.

SER: Specifies a single volume or many volumes.REF: gives reference to a cataloged dataset passed. It can be used to retrieveinformation from existing catalog or passed datasets.

Ex:// UNIT=SYSDA

Defaults to the available systems device available.

// UNIT 3390, VOL=SER=TST004Will use a 3390 disk drive identified as TST004.

// UNIT=TAPE, VOL=SER=012345Will use any available tape drive and mount volume 012345.

// UNIT=TAPE, VOL=SER=(012345,023456,034567).Will use any available tape drive and mount the tapes on that drive in thisorder.

// UNIT=TAPE, VOL=REF=*.NG081A.

Page 15: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 15

Will use any tape drive available and the tape to mount is referenced incatalog from a previous step. In this case, the step previous within thesame job was NG081A.

LABELLABEL subparameters are EXPDT and RETPD. Both are used regularly in the LifeEnvironment to protect or release data. EXPDT or RETPD must be on all newly createddatasets or they will be lost overnight.

EXPDT � is coded to a specific date that data will be released.

EXPDT=yyyy/dddGives the expiration date for the data set. For MVS/ESA systems only, the yyyy/ddd value is afour-digit year followed by a three-digit Julian day number; for example, 1996/232 is the twohundred thirty-second day of year 1996.

RETPD � is coded to retain the data for a number of days.

RETPD=nnnn'nnnn' is the number of days after which this data set is

eligible for deletion. 'nnnn' can be any number in the range 0000 through 9999. Leading zeroes can be omitted.

EX:LABEL=EXPDT=1999003

Specifies the year 1999 and the day 3 to expire this data.LABEL=RETDT=90

Specifies to keep this dataset for 90 days.

** NOTE: RETPD can be coded with LABEL= or by itself, but EXPDT must be codedwith Labels.

SPACEThe SPACE parameter is used to request a specific amount of disk storage space. Thisshould be coded only for a disk dataset, not tape datasets. All requests for disk space arecategorized as either primary or secondary allocations. Space can be allocated incylinders, tracks, or blocks.

**Note: The abbreviation for cylinder is CYL and track is TRK. CYL allocates space incylinders CYL is a convenient unit to select with large datasets. TRK allocates in tracks.TRK is often used with small datasets where TRK comes closest to fitting the actualspace requirements. Once space is allocated, there is a third subparamter of space isused. They are: RLSE and CONTIG.

CONTIG � Specifies that the entire primary allocation must be contained within a singleextent.

RLSE � Used to return allocated space that is not needed to a disk volume. When coded,all unused space is release and becomes available.

Page 16: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 16

EX:SPACE=(CYL,1)

This will allocate one Cylinder.SPACE=(TRK,30)

This will allocate 30 tracks.SPACE=(TRK(10,1)RLSE)

This is saying that you will use a primary allocation of 10 tracks. If more spaceis needed, the system will allocate one track at a time for the secondaryallocation. This one additional track will be tried for a maximum of 15 times.This means that if all tracks were allocated, the most you would use are 25tracks.

SYSOUTThe SYSOUT parameter names the output class to which the printed output will be sent.If Sysout=* or SYSOUT=$ is coded, this dataset is automatically sent to the same outputclass as the MSGCLASS parameter in the job statement. To send output to $AVRS, theJOB statement should have MSGCLASS=4 and the SYSOUT should have � SYSOUTDD *. SYSOUT=A or SYSOUT=1 can be requeued to the system printer after browsingon the 3.8 screen; however, it will take 2-4 hours to be delivered to you.

DCB (Data Control Block)A DCB parameter will describe the characteristics of the records in a dataset. There aremany subparameters of the DCB. We will discuss only the commonly used ones withinthe Life Environment. They are: LRECL, BLKSIZE, RECFM, DSORG, BUFNO, andOPTCD = B. For information on other subparameters, look in QW(Quick ReferenceManual).

LRECL � Stands for logical record length. The LRECL subparameter specifies the sizeof the record and the program it is processing.

BLKSIZE � Specifies the size of a physical record. A physical record or block consistsof the data that is actually written or read from an I/O device.

RECFM � Stands for record format. RECFM specifies whether logical or physicalrecords are fixed in length or vary in size. RECFM classifies every dataset into one offive categories. The five possible logical record values are:

F Fixed lengthV Varible lengthU Undefined or unspecified (also variable) lengthVS (Variable) spanned lengthD (Variable) ASCII records (Life Environment data with F,V, or U)

The first four formats F,V,U, and VS are EBCDIC. There are five additional letters to becoded with RECFM. Each of them will interact with one or more of the above fivevalues. Again, we will discuss only what is currently used in the Life Environment.

B � The logical records in the dataset is blocked. B should not be coded with U, but it isallowed with the other four values defined above.

Page 17: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 17

When a dataset is printed, the first byte of each logical record may be used for carriagecontrol. One of two values may be coded to identify the type of carriage control used:

A � The first byte of each record is used as an ANSI carriage control character.M � The first byte of each record is used as a machine carriage control character.

Some of the most commonly coded RECFM values are listed below:

RECFM=F All logical records are the same size. Each physical record containsexactly one logical record. The accompanying LRECL and BLKSIZEvalues should be the same, so usually only BLKSIZE is coded in theJCL.

RECFM=FB All logical records are the same size. As many complete logical recordsas will fit are place on a block, so RECFM=FB should be accompaniedby a BLKSIZE value which is an integral multiple of the LRECL. Thesame results occur when RECFM=BF is coded. The RECFMsubparameter values may be coded in any order.

RECFM=FBA This is the same as coding RECFM=FB, but now the first byte of thelogical record is used for a carriage control.

RECFM=FBMThis is the same as coding RECFM=FB, but now the first byte of thelogical record is used for a machine carriage control.

RECFM=V Both logical and physical records are variable length. The first fourbytes of each logical record contain its length. The LRECL value mustspecify the length of the largest possible record in the dataset +4. ForRECFM=V, BLKSIZE=LRECL +4.

RECFM=VB For RECFM=VB, they must be greater than or equal to LRECL +4. Thenotion of a true blocking factor is only used with fixed length records; itdoes not make sense with variable length records. Hence, BLKSIZEneed not be set to equal 4 plus a multiple of the LRECL.

RECFM=U Undefined records are variable length. However, they do not contain afield that holds their length. With undefined records each block containsexactly one logical record, so it is sufficient to code just BLKSIZE andomit LRECL.

DSORG Is Dataset organization. The value coded with a DSORG subparameterwill be one of four non-VSAM dataset organizations.

PS � Physical Sequential. This is the default value and need not becoded. Most of our data will be physical sequential.

IS � Indexed Sequential. This is an ISAM (Indexed Sequential AccessMethod) dataset. These datasets consist of data and index components.As for now, they are outdated, but may still exist and would have to bedefined via DSORG.

Page 18: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 18

DA � Direct Access. DA should be coded whenever a direct accessdataset is created and occasionally when it is retrieved.

PO � Partitioned Organization. PO identifies partitioned datasets orlibraries. DSORG=PO is coded only for documentation. PO is usedwhen the dataset is created without a request for directory space. Rarelyis it necessary to code DSORG=PO when retrieving an existing PDS.

Here are examples of DCB and DSORG JCL statements:// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB,DSORG=PS)// DCB=(BLKSIZE=6356,LRECL=6352,RECFM=VB)// DCB=(BLKSIZE=32760,LRECL=32756,RECFM=VB)// DCB=(BLKSIZE=19069,RECFM=U)

BUFNOThis is a subparameter that specifies the number of buffers to assign to a dataset.Dependent on the dataset organization, the default values range from 2 to 5.BUFNO is an important subparameter when processing a sequential data set ornumber of PDB libraries.

EX:// DCB=(BLKSIZE=4000,LRECL=1,RECFM+FBA,DSORG=PS,BUFNO=2)

Page 19: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 19

NULL and COMMENT Statements

Two other JCL statements may be of use to use to you, the Null statement and the Commentstatement.

NULL Statement � This statement may be used to mark the end of a job. It is coded with twoslashes (//) in columns one and 2 with no other characters.

COMMENT Statement � Comments are sometimes coded as an aid to documenting JCL.Columns 1-3 contain (//*). The �comment� is coded in columns 4-80.

Page 20: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 20

Summary of the three major JCL statements:

Name of Statement Purpose

JOB Marks the beginning of a job; assigns a name tothe job.

EXEC Marks the beginning of a job step, identifies theprogram to be executed.

DD Identifies a data set and describes its attributes.

Page 21: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 21

Detecting Coding Errors

Error code descriptions can be found in the QW(Quick Reference Manual). Using a TSO session(HINT: ISPF Panel 6), type QW and press [ENTER]. You will come to the Quick ReferenceMenu.

Please do the following activities so that you can become more familiar with the QW Manual.

ACTIVITY 1:

1. Type QW from the command line of any ISPF Panel and press [ENTER]. This will bring upthe QW Main Menu Panel.

Page 22: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 22

2. Enter an R on the command line and press [ENTER]. You will now be in the QuickReference Information Panel.

3. Enter S0C7 on the Item Line and press [ENTER].

4. Select the line IBM0S390 System codes by putting an S next to the appropriate line. Press[ENTER].

Page 23: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 23

5. You should now see the description for the S0C7 Abend. This is one of the most commonabends in Assembler.

ACTIVITY 2:6. Use QW (Quick Reference) to determine the meaning of the following error codes(Hint:

Item line):

Abend Codes: Descriptions:

S637

S0C1

S0CA

S813

SB37

SD37

7. You will see additional error codes on the following page regarding JCL errors.

ACTIVITY 3:8. Press [F3] until you are at the QW Main Menu.9. Enter a C on the command line and press [ENTER].10. Select the Codes category.11. Find write-ups for codes in Activity 2.12. This is another way to search for activity codes.

Page 24: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 24

We will look at some sample error messages you could receive while running a job. All of theseerror messages can be found in the Quick Reference Manual.

Example 1:IEF642I JCL Statements

//LA$JOE JOB 31SPC03090156W,CLASS=B//STEP#FOUR EXEC PGM=IEFBR14

Error Message received:IEF642I EXCESSIVE PARAMETER LENGTH OF THE EXEC STATEMENT

The stepname, STEP#FOUR, is not valid. The maximum length allowed for stepnamesis 8 characters.

The code IEF6421I is in the IBM manual accessed by QW. This error will be listed as amessage.

Example 2://LA$JOE JOB 31SPC03090156W,CLASS=V//STEP6 EXEC PGR=IEFBR14

Error Message received:IEFC630I UNIDENTIFIED KEYWORD ON THE EXEC STATEMENT

This means that PGM has been misspelled (PGR).

Example 3:

//LA$JOE JOB 31SPC03090156W,CLASS=B//STEP#FOUR EXEC PGM = IEFBR14

Error Message received:IEFC612I PROCEDURE NOT FOUND

This message was received because there are blank spaces within the PGM parameter. Itshould read PGM=IEFBR14.

Page 25: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 25

Please see your mentor so that you can print off a copy of Systems Communication C1614(From Systems Communications Database Notes 003) for Jobclass information.

The following activities have been designed to specifically help you apply the JCL informationyou have read about in this section. Please see your mentor if you have any problems orquestions when doing the exercises.

JCL EXERCISES

1) Copy 100 records from a tape dataset to a TSO dataset.a) Print the write-up for NG081 from the Life Computer Operations Manual.b) Ask your mentor for the name of a production tape dataset that you might be using on

your project.c) Find the Volume Serial number for the most recent creation of the tape dataset. (Hint:

Use M.3.2)d) Find the DCB information (LRECL, BLKSIZE, and RECFM).e) Create member NG081 in your ISPF.JCL to copy the 1st 100 records of the tape dataset

into a TSO dataset in your catalog.i) Hints:

(1) The JOBNAME should begin with your 4-digit logon ID.(2) Optional DD statements do not need to be included.(3) Required DD statements that we don�t need should be coded as DD DUMMY.(4) Retain the dataset you create for 4 days.(5) Have all messages go to SAVRS.(6) Your JOBPARM statement should have S=5100.

f) Submit the JOB (Type SUB in the command line and press enter).g) Find and browse the job output on SAVRS.h) Browse the newly created dataset. (HINT: Use both ISPF panels 3.4 and M.1)

i) Did you get 100 or fewer records?ii) When does your new dataset expire?

2) Copy a TSO dataset to another tso dataset.a) Edit your newly created ISPF.JCL(NG081) member.b) Duplicate everything in the member by over-typing the left-hand end of the first line

number and the last line number with �RR� (ISPF Repeat block command).c) Insert a Null Statement prior to the 2nd JOB STATEMENT.d) Change the input tape dataset name to the name of some dataset from your mentor�s

catalog. (NOTE: You will also need to change some other information.)e) Change the name of the dataset you are creating. (NOTE: You might have to change the

DCB information. Check the format of your mentor�s dataset on 3.4).f) Copy the entire dataset, NOT JUST THE FIRST 100 RECORDS.g) Submit the job.h) Browse the job output on SAVRS.

i) Did one or two jobs run? Why? ii) Did all the records get copied? (HINT: Count the number of records in the original

dataset and the newly created dataset. By doing a tso count from the command line orfrom ISPF panel 6 on both datasets.)

Page 26: jcl

State Farm Post-IPEP Manual � JCL Section (last updated 07/31/00) 26

3) Copy a tso dataset to a tape dataset.a) Edit your ISPF.JCL(NG081) member.b) Change the dataset being created to a tape dataset.

i) The name will not end with �.data� or �.dxxx�.ii) Look back in the JCL section and determine whether the SPACE parameter is

necessary.c) Remove the 2nd JOB and JOBPARM STATEMENTS from the JCL.d) DO NOT remove the Null Statement prior to the 2nd Execute Statement.e) Submit the Job.f) Browse the job output on SAVRS.

i) Did both EXEC statements process? (Only the 1st should have processed).ii) What is the VOL=SER number of the newly created tape dataset.iii) When does it expire?

g) Change the JCL one more time.i) Remove the Null Statement.ii) Change the tso and tape datasets that are being created.iii) Submit the Job.iv) Browse the job output on SAVRS.

(1) Did both execute statements get executed? (They should have.)(2) How is this different than what happened in exercise 2?

h) Ask your mentor why you might want to have several execute statements within one JCLmember that execute the same program.