Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

JCL Imp

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

JCL :-

Sorting file

SORT/ICETOOL

//SYSIN DD *
SORT FIELDS=(17,5,CH,A)
/*

Sorting files and eliminating duplicates


//SYSIN DD *
SORT FIELDS=(17,5,CH,A)
SUM FIELDS=NONE
/*

Split file into 2-3 files - OUTFIL


//SORTOF01 DD SYSOUT=*
//SORTOF02 DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(1,6,CH,EQ,C'AKAJAA')
OUTFIL FILES=02,INCLUDE=(1,6,CH,EQ,C'DDGHDG')
/*

copy records depending upon condition


//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(1,6,CH,EQ,C'AKAJAA')
/*

formating a file (Using INREC)


//SYSIN DD *
SORT FIELDS=COPY
INREC FIELDS=(7:2,5,20:10,3)
/*

Difference between INREC & OUTREC


INREC - adds, deletes or reformats fields before records is sorted and merged -
Performance improved
OUTREC - adds, deletes or reformats fields after records is sorted and merged

Common JCL errors

SOC7 - 1. Moving non-numeric value to numeric field (Imp)


2. Not initilizing the numeric variables before first use
resolve SOC7
go to spool, check sysdump and copy offset
value,than come to jcl,in command line type F Offset value
more causes
1.Numeric Operation on Non-numeric data
2.Coding past the maximum allowed subscript.
3.Un-initialize working storage.

***What needs to be done if job abends with S0C7 while processing a million records
SOC7 abend error is displayed when there is invalid data inside the comp field and
the program is processing some computation on it.
To start with, check the data you are passing as input because there must be some
corrupt data which is the root cause of this error.
Here are some steps to solve this error:
If the method of input is a file and you do have a file-aid and input data layout,
use the file-aid to segregate the data on a field level.
File-aid will now highlight any of the incorrect data which is Invalid.
Now that you have found the data which is invalid, fix the data issue.
***Please check the offset number... compile the program...go to sysut of it...
search for F hexloc...then you will get the desire range where problem may get
abended..

SE37 - Insufficient disk space. (Imp)


Space ABEND - When there are no more volumes available - Compress the data set,
Allocate a larger data set and copy into it by doing the following

S222 - S222 means job was cancelled by a user or operator.


when the program is in loop , in time out situation we face this abend., we
cancel this job
program run out of time then it throws error s222

S0C4 - S0C4 occurs mainly due to protection exception. It means


when you trying to move a larger variable to a small
variable
protection exception. It meanswhen you are using subcripts for example my
subsripts range
is 11 but I am trying 12 & your compiler option is ssrange
you got soc4 error.
SOC4 abend may be due to the following reasons.
1.Missing SELECT statement ( During Compile time)
2.Bad Subscript/Index
3.Read/Write attempt to unopened file
4.Move data to/from unopened file
5.Missing parameters in called subprogram

Conditional Restart -
JCL RESTART is an optional keyword parameter which is used to restart a job from a
particular step.
RESTART parameter is coded in the JOB or EXEC statement and it helps in manual
restart of the JOB/STEP after the job failure.
RESTART=STEP20

condition start -
COND parameter - COND = (0,EQ,STEP1),COND=EVEN,COND=ONLY

Imp JCL ulitily


IEHMOVE,IEHPROGM,IEHCOMPR,IEBCOPY,IEFBR14,IEBEDIT,IDCAMS

What is time parm in JCL? If job has time parm as 10 and three steps in it has 5
each what will happen in this scenario?
TIME Parameter in JCL is a Keyword parameter which indicates the Processor Time
required to execute the job/step in a JCL.
This can be used either in JOB or in STEP or in both the places
NOLIMIT vs 1440:
Both the parameters are same and allows the JOB to use maximum time limit.
****STEP parameter overrides JOB -
Imp- hould be less than the Time remaining(from the JOB level value )after
execution of the previous steps.
If it is greater then, remaining time would be taken.

How to check the empty dataset in jcl ?


//MG9908EM JOB 0000,'TEST',CLASS=6,MSGCLASS=X,NOTIFY=&SYSUID
//M010 EXEC PGM=IDCAMS
//INFIL01 DD DSN=MG9908.TEST.EMPTY.F001,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSIN DD DATA
PRINT INFILE(INFIL01) COUNT(1)
/*

GDG - Generation data group


Group of files related to each other
ulitily = IDCAMS
generating base
//SYSIN DD *
DEFINE GDG(NAME(BANK.CUST.MONTHLY) -
LIMIT(12)
NOEMPTY /empty limit reached
SCRATCH /noscratch delete generation when uncatalogued
/*

You might also like