Archive for category JCL

Most Common JCL Error Codes

S001 An I/O error ocurred. Check reason code for exact cause. Examples are trying to read beyond End of File, trying to write to an input file or a file length error.
S002 Invalid I/O record, eg attempting to write a record that is longer than the maximum record length.
S004 Error occured during OPEN. Eg Invalid DCB.
S013 Error OPENing a dataset, eg PDS member does not exist, record length in program doesn’t match dataset’s record length.
S0C1 Operation Exception. Check for subscript errors, missing DD card, file not opened.
S0C4 Protection Exception/Storage Violation. Trying to access storage not available to the program. Can be caused by a subscripting error or reading/writing a file that isn’t open.
S0C7 Program Check Exception – Data. Check for spaces in a packed decimal or numeric field. Check to see if record layouts or file layouts have been changed.
Sx22 Job has been cancelled. The value of x will vary depending on the way the job was cancelled. S222 means job was cancelled by a user or operator without a dump. If a TSO session times out you will probably get an S522 abend code.
S806 Unable Link or Load. The job was unable to find the specified load module. Check that the job is looking at the correct Load Libraries, specify a STEPLIB if required.
S80A Not enough Virtual Sorage to satisfy a GETMAIN or FREEMAIN request.
S822 Unable to obtain to obtain enough space to satisfy a REGION= request May need to change REGION statement in the JCL..
S878 Not enough storage available to satisfy a GETMAIN or FREEMAIN request.. Job was anable to allocate an area of memory of the correct size. Try Specifying or amending the ‘REGION=’ JCL statement.
S913 You are trying to access a dataset which you are not authorized to use.
Sx37 Unable to allocate enough storage for a dataset. You might need to increase the amount of primary and secondary space to be allocated for a dataset in the ‘SPACE=’ parameter, or you may have to move the dataset to a different DASD devive which has enought space to store the dataset. ‘x’ will vary, likely Abends are SB37, SD37 or SE37.
U1020 I/O Logic error. Typical reasons are; trying to write to a file opened as input; Rewrite without a previous read. See the message IGZ020I for details of the exact reason.
U1035 Inavlid OPEN/CLOSE. Check there is a DD statement for the file. See the message IGZ035I for more detailed information.
001 I/O ERROR
002 I/O INVALID RECORD
004 OPEN ERROR
008 I/O SYNAD ERROR
013 OPEN ERROR
028 PAGING I/O ERROR
0CX PROGRAM CHECK EXCEPTIONS:

0C1 OPERATION
0C4 PROTECTION / ADDRESSING
0C5 ADDRESSING

 

706 NON-EXECUTABLE PROGRAM
804 INSUFFICIENT VIRTUAL STORAGE
806 UNABLE TO LOAD (LINK ETC) PROGRAM
80A INSUFFICIENT VIRTUAL STORAGE
878 INSUFFICIENT VIRTUAL STORAGE
737 I/O ERROR
A14 I/O ERROR
B37 The system allocated all the primary and secondary space it could, but it still could not write the output.
D37 Primary disk space was exceeded and no secondary space has been specified, or it has been exhausted.
E37 This often occurs when you try to add members to a PDS, and you get E37 ABEND. It occurs because the PDS Directory require more space for its members, than it was initially alloted.

No Comments

Types of JCL Statements

JOB – Identifies the beginning of a job. The JOB statement informs the operating system of the start of a job, gives the necessary accounting information, and supplies run parameters. Each job must begin with a single JOB statement

 

EXEC – Indicates what work is to be done. EXEC (execute) statement is used to identify the application program, cataloged procedures or in-stream procedure that the job is to execute and to tell the system how to process the job.

 

DD – (Data Definition) Identifies what resources are needed and where to find them. A DD statement must be included after the EXEC statement for each data set used in the step. The system ensures that the requested I/O devices can be allocated to the job before execution is allowed to begin.

 

No Comments

Create a History Data Set from Log Data Recorded on the Logrec Log Stream

The following JCL creates a history data set from log data recorded on the Logrec log stream

//LOGRECHS JOB,MSGLEVEL=(1,1),MSGCLASS=X,NOTIFY=&SYSUID
//EREPDALY EXEC  PGM=IFCEREP1,PARM=('HIST,ACC=Y,SYSUM')
//ACCIN    DD DSN=SYS1.SYSPLEX.LOGREC,
//            SUBSYS=(LOGR,IFBSEXIT,,'DEVICESTATS,LASTRUN'),
//            DCB=(RECFM=VB,BLKSIZE=4000)
//ACCDEV   DD DSN=MVS.LOGREC.LGSTREAM.HISTORY,
//            DISP=(NEW,CATLG),
//            DCB=(RECFM=VB,BLKSIZE=4000),
//            UNIT=SYSDA,SPACE=(CYL,(25,5))
//SERLOG   DD DUMMY
//DIRECTWK DD UNIT=SYSDA,SPACE=(CYL,15,,CONTIG)
//TOURIST  DD SYSOUT=A,DCB=BLKSIZE=133
//EREPPT   DD SYSOUT=A,DCB=BLKSIZE=133
//SYSABEND DD SYSOUT=A
//SYSIN    DD DUMMY
/*

No Comments

List the Information from the Logrec Data Set

Next are a few examples of Jobs to list information from the Logrec Data Set:

1. Detail Edit Report

This job generates detail edits and summaries of all software and operational records:

//EREPRPT1 JOB,MSGLEVEL=(1,1),MSGCLASS=X,NOTIFY=&SYSUID
//REPORT1   EXEC  PGM=IFCEREP1,PARM='CARD'
//ACCIN     DD  DSN=MVS.LOGREC.HISTORY,DISP=SHR
//DIRECTWK  DD  UNIT=SYSDA,
//              SPACE=(CYL,5,,CONTIG)
//EREPPT    DD  SYSOUT=A,DCB=BLKSIZE=133
//TOURIST   DD  SYSOUT=A,DCB=BLKSIZE=133
//SYSIN     DD  *
PRINT=PS
TYPE=SIE
HIST
ACC=N
ENDPARM
/*

2. Event History Report

The following is a two-step job. The first step prints an event history report for all Logrec data set records. The second step formats each software, IPL, and EOD record individually.

This Job can be a very useful tool to the problem solver because it prints the records in the same sequence they were recorded and therefore shows an interaction between hardware error records and software error records.

//EREPRPT2 JOB,MSGLEVEL=(1,1),MSGCLASS=X,NOTIFY=&SYSUID
//* -------------------------------
//* - STEP 1 ----------------------
//* -------------------------------
//*
//EREPA EXEC PGM=IFCEREP1,PARM='EVENT=Y,ACC=N',REGION=256K
//SERLOG DD DSN=SYS1.LOGREC,DISP=SHR
//TOURIST DD SYSOUT=A
//EREPPT DD SYSOUT=A,DCB=BLKSIZE=133
//SYSIN  DD DUMMY
//*
//* -------------------------------
//* - STEP 2 ----------------------
//* -------------------------------
//*
//EREPB EXEC PGM=IFCEREP1,PARM='TYPE=SIE,PRINT=PS,ACC=N',
//   REGION=256K
//SERLOG DD DSN=SYS1.LOGREC,DISP=SHR
//TOURIST DD SYSOUT=A
//EREPPT DD SYSOUT=A,DCB=BLKSIZE=133
//SYSIN  DD DUMMY
/*

3. Detail Summary Report

This job generates detail summaries of all I/O errors:

//EREPRPT3 JOB,MSGLEVEL=(1,1),MSGCLASS=X,NOTIFY=&SYSUID
//REPORT3  EXEC  PGM=IFCEREP1,PARM='CARD'
//ACCIN    DD DSN=MVS.LOGREC.HISTORY,DISP=(OLD,PASS)
//DIRECTWK DD UNIT=3390,
//            SPACE=(CYL,5,,CONTIG)
//EREPPT   DD SYSOUT=A,DCB=BLKSIZE=133
//TOURIST  DD SYSOUT=A,DCB=BLKSIZE=133
//SYSIN    DD  *
PRINT=SU
TYPE=DOTH
DEV=(N34XX,N3704,N3705,N3720,N3725,N3745)
HIST
ACC=N
ENDPARM

For more information regarding the parameters and control statements used in these jobs check the following links:

  • EREP Report Parameters
  • EREP Selection Parameters
  • EREP Processing Parameters
  • EREP Control Statements

No Comments

Create a History Data Set from the Logrec Data Set

By creating a history file and then running all the reports against that file, the Systems Programmer ensures that all of the reports are using the same set of records.

//LOGRECHS JOB CLASS=A,MSGLEVEL=(1,1),MSGCLASS=X,NOTIFY=&SYSUID
//*------------------------------------------------------------------
//* COPIES SYS1.LOGREC TO HISTORY FILE MVS.LOGREC.HISTORY
//*------------------------------------------------------------------
//HISTORY EXEC PGM=IFCEREP1,REGION=1024K,
// PARM='ACC,ZERO=N'
//SERLOG DD DISP=(OLD,KEEP),DSN=SYS1.LOGREC
//ACCDEV DD DISP=(NEW,PASS),DSN=MVS.LOGREC.HISTORY,
// UNIT=3390,SPACE=(CYL,(2,2)),
// DCB=(RECFM=VB,BLKSIZE=6144)
//DIRECTWK DD DISP=(NEW,DELETE),UNIT=3390,SPACE=(CYL,2,,CONTIG)
//EREPPT DD SYSOUT=A,DCB=BLKSIZE=133
//TOURIST DD SYSOUT=A,DCB=BLKSIZE=133
//SYSIN DD DUMMY
/*

No Comments

How to clear and re-initialize the Logrec Data Set SYS1.LOGREC

It’s not uncommon for the SYS1.LOGREC dataset to fill up. Although you should dump the content of the SYS1.LOGREC to DASD or Tape to keep that information for future use (if you need to analyse a problem), you sometimes may simply wish to clear all its content and re-initialize it. The solution is to run IFCDIP00.


//IFCDIP00 JOB CLASS=A,MSGLEVEL=(1,1),MSGCLASS=X,NOTIFY=&SYSUID
//********************************************************************
//* CLEAR AND INITIALIZE HARDWARE EVENT RECORDER DATASET             *
//********************************************************************
//IFCDIP00 EXEC PGM=IFCDIP00
//SERERDS  DD  DSN=SYS1.LOGREC,DISP=OLD,
//             VOL=SER=MVSRES,
//             UNIT=3390

In this example we will clear and re-initialize the content of SYS1.LOGREC located on volume MVSRES.

No Comments

Defining a Logrec Log Stream

First of all and before defining a Logrec log stream, the Systems Programmer should make sure that the system in question was IPLed with a Logrec data set initialized by IFCDIP00. If this is not the case, you cannot change the Logrec recording medium from LOGSTREAM to DATASET using the SETLOGRC command and therefore you’ll have to IPL the system in order to be able to use the Logrec log stream you’ve defined.

To use the Logrec log stream, the Systems Programmer must first set up the system to use system logger functions. IBM recommends that you use a coupling facility log stream for LOGREC so that you can merge data from multiple systems in a sysplex.

On a single system sysplex (monoplex) the system can also use a DASD only log stream (which is single system in scope). However, this is not recommended for a multi-system sysplex because since we can only have one Logrec log stream per sysplex, this would mean that if using a DASD only Logrec log stream, only one system of the sysplex would be able to access it. Therefore for a multi-system sysplex it is advisable to use a LOGSTREAM Logrec log stream.

JCL:

// IXCMIAPU JOB CLASS=A,MSGLEVEL=(1,1),MSGCLASS=X,NOTIFY=&SYSUID
//DEFINE   EXEC PGM=IXCMIAPU
//SYSPRINT DD   SYSOUT=A
//SYSIN    DD   *
DATA TYPE (LOGR)
DEFINE STRUCTURE NAME(LOGRECSTRUCTURE)
LOGSNUM(1)
AVGBUFSIZE(4068)
MAXBUFSIZE(4068)
DEFINE LOGSTREAM NAME(SYS1.SYSPLEX.LOGREC)
STRUCTNAME(LOGRECSTRUCTURE)
/*

MAXBUFSIZE must be at least 4068 because logrec writes records in one page blocks. Specify SMS storage group, storage, data and management classes such that when one data set is full, another is allocated. Allocate as much space as is allocated for all the logrec data sets on the systems in the sysplex before migrating to a Logrec log stream.

To start using the Logrec log stream either specify LOGREC=LOGSTREAM in the IEASYSxx parmlib member or, after IPLing with LOGREC=dsname, use the SETLOGRC command to change the Logrec recording medium to a Logrec log stream. Bear in mind though that if you IPL the system with LOGREC=LOGSTREAM, you cannot use the SETLOGRC command to change the Logrec recording medium to a Logrec data set.

Important!

Now you have the Logrec log streams defined and ready, and you have even set up the system to start using them. Are you done with your tasks? The answer is no! You still need to update the EREP jobs that your system uses to start using the Logrec log stream. To do this the Systems Programmer will have to go through the JCL and:

  • Change the SERLOG DD DSN=SYS1.LOGREC statement associated with a Logrec data set to an ACCIN DD DSN=SYS1.SYSPLEX.LOGREC statement, with corresponding SUBSYS parameters, to associate EREP with the logrec log stream.
  • Identify the input as a history data set. Leave the output to a history data set as currently recommended, because all subsequent steps should already use the history data set as input. (Note: using a Logrec log stream as input for multiple steps is not recommended because each subsequent step processes more records than the prior, causing numbers and data in successive reports not to match).
  • Subsequent EREP report steps that normally process history data sets no longer need to concatenate one history data set per system.

No Comments

How to define the Logrec Data Set SYS1.LOGREC

If you want to define a Logrec Data Set, you must first allocate it and then initialize it.

//IFCDIP00 JOB CLASS=A,MSGLEVEL=(1,1),MSGCLASS=X,NOTIFY=&SYSUID
//*------------------------------------------------------------------
//*  CREATE A NEW LOGREC DATASET AND INITIALIZE IT
//*------------------------------------------------------------------
//IFCDIP00 EXEC PGM=IFCDIP00
//SERERDS  DD  DSN=SYS1.LOGREC,DISP=(,CATLG),
//         VOL=SER=MVSRES,UNIT=3390,SPACE=(CYL,3,,CONTIG)
/*

In this example we create and initialize Logrec Data Set SYS1.LOGREC located on volume MVSRES.

Note: the newly allocated Logrec data set will not be used until you initialize it and IPL the system on which it is to be used.

No Comments

Using IEBCOPY to compress a Data Set

Here’s an example of a IEBCOPY job to compress a data set:


//COMPRESS JOB (),'RMF',NOTIFY=&SYSUID,CLASS=A,MSGLEVEL=(1,1),
// MSGCLASS=X
//*******************************************
//*
//* COMPRESS A DATA SET USING IEBCOPY
//*
//*******************************************
//STEP1 EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//INPUT DD DSNAME=SYS1.EXAMPLE.FILE,DISP=SHR
//OUTPUT DD DSNAME=SYS1.EXAMPLE.FILE,DISP=SHR
//SYSIN DD *
COPY INDD=INPUT,OUTDD=OUTPUT
/*

Note that we are using the same dataset for INPUT and OUTPUT.

No Comments

JCL most common operands

1. JOB Statement

REGION= Requests specific memory resources to be allocated to the Job
NOTIFY= User to be notified at job completion
USER= Userid to assume authority to the Job
TIME= Limits the amount of time a program can run
TYPRUN= Delays or holds the Job from running
CLASS= Directs JCL to execute on a particular Input queue
MSGCLASS= Directs Job output to a particular Output queue
MSGLEVEL= Controls the number of system messages to be received

2. EXEC Statement

PGM= Executable program name
PROC Procedure name
PARM= Parameters known by and passed to the program
COND= Boolean logic for controlling the execution of other EXEC steps in this job
TIME= Imposes a time limit

3. DD Statement

DSN= Name of the data set
DISP= Data Set disposition (see below for more information)
SPACE= Amount of disk storage request for a new data set
SYSOUT= Defines a print location (and the Output queue or data set)
VOL=SER= Volume name, disk name, or tape name
UNIT= System disk, tape, special device type, or esoteric
DEST= Routes Output to a remote destination
DCB= Data Set Control Block: LRECL, RECFM, BLKSIZE, DSORG
LABEL= Tape label expected (No Label or Standard Label followed by the Data Set location)
DUMMY Results in a NULL Input or throwing away data written to this DD name
* Input data or control statements follow

DISP parameter

Define as DISP=(status, normal end, abnormal end)

Status

NEW
  • Indicates that a new data set is to be created.
  • This job has exclusive access to the data set while it is running.
  • The data set must not already exist
OLD This job is to have exclusive access to the data set while it is running
SHR Several concurrent jobs can share access to this data set while they are running
MOD
  • The current job must have exclusive access to the data set while it is running
  • If the current job opens the data set for output, the output will be appended to the current end of the data set

Normal and Abnormal Ends

DELETE Delete and uncatalog the data set at the end of the job step
KEEP Keep the data set at the end of the job step but do not catalog
CATLG Keep the data set at the end of the job step and catalog it
UNCATLG Keep the data set but uncatalog it at the end of the job step
PASS Allow a later job step to specify a final disposition

No Comments