Você está na página 1de 24

KNOWLEDGE MANAGEMENT ON JCL UTILITIES

 Pointer Mechanism
The SPACE function is used to position the pointer at a specific record.
e.g.) At first control card places the pointer at the 25th record. The second control
card copies the next 6 records. Give this code inside the SYSIN card

$$DD01 SPACE IN=25


$$DD01 COPY OUT=6

 FASTDEL
This utility deletes all cataloged files as coded in SYSIN statement. Acts similar
to TSO DEL 'filename' option.
e.g.)
//JS0010 EXEC PGM=FASTDEL
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
ECSA40T.FILE.DOT.DELETE
//*
//*

 Compressing a PDS via Program

Here is a sample code to zip a PDS if the allocated memory overflowed.


e.g.)

//ECSA40T JOB LA5516,'ECSA40T',REGION=0M,


// CLASS=S,MSGCLASS=X,NOTIFY=&SYSUID
//*
//step01 EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=A
//SYSUT1 DD DSN=(name),DISP=(OLD,KEEP)
//SYSINDD *
COPY OUTDD=SYSUT1
INDD=SYSUT1
Alternate way to compress a PDS, here is the screen print to Zip in simple way.

Below screen prints shows the PDS after compressing,


 Defining GDG base using TSO Option
Type the below command in the “Command line” It will ask for the Base
name & limit (Number of generations).
Below screen shots will give a clear picture,
Once command is typed simply type enter at first it will ask for the GDG base name,

After hitting the Enter key, it will ask for the Base name of the GDG,
After giving the base name it will ask for number of generations too,
A GDG base is created with one line TSO command,
 Sort operation without using Program
Instead of using JCL to perform sort operation, one simple alternative,
e.g.) Open a flat file in edit mode, on the command line type “SORT 1,7 "
it will be on positions 1(starting position) to 7(End position) bytes
Here in the sample file, sorting is based on the voucher line number see the
corresponding changes in the voucher level, first record remains the same but from
second record onwards you can find the sorted order
The below screen shots gives you the sorted order on voucher line number basis,
Below screen prints shows the difference in the 22nd position,
 RETP on the command line
This used to retrieve the last 25 commands typed in TSO session.
Below screen print shows the list of commands used
The following screen shots list the last 25 TSO commands used….
 SORT CHANGED
It's to find the last edited member but it won’t work with the PDS.
Below screen shots list the jobs in normal view….Please have a look on the last changed
date column.
After hitting the “sort cha“command, please have a look at the last changed date. The
jobs will listed on basis on the recent modified dates.
 NRETRIEV
Retrieving often-used datasets...last 30 accessed datasets. It will be useful
one in time saving. Basically the command has to assigned to any of the
functional key.
e.g.) Type the word key in command & assign the NRETRIEV in any of the
functional keys like F2. Below screen shot will display how to assign the command in
the functional key.
Then start 3.4 option & go to the DSN naming level then start hitting the assigned key for
retrieve command. It will retrieve the last 30 accessed data sets. Below screen print show
how it’s retrieving the last accessed datasets.

 Protecting a dataset
This code the keep the dataset till the specific period, say one year in
terms of days.
E.g

TO(04365) LABEL=RETPD=04365 //Will protect till end of 2004

Reverse is also possible by the below piece of code,

e.g.,
//STEP1 EXEC PGM=EXEC
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE ECSA40T.IVISAP71.ACE.DATA -
PURGE
/*
 File Aid Browse/ Edit

While viewing a VSAM data, we use to go via browse mode in some case
we think of editing the data, usually we come out of the browse mode then
will give the option “D;F;2 instead of “D;F;1”
Below screen shot gives the same file in edit mode even saving the data is also
possible.
Thru edit mode saving the VSAM file is also possible.

 VSAMEMT=YES
To avoid the empty VSAM file abend. Here is the sample code,

//STEP3 EXEC PGM=SORT,PARM=’VSAMEMT=YES’
//*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=VSAM.DSN
// DISP=SHR
//SORTOUT DD DSN=FLATFILE.DSN
// DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
/*

 Filtering the spool jobs

TO filter the spool jobs as per the return code. Below is the screen prints
for the ideal case.
This command will filter only the spool jobs retuned maximum return code of
“JCL Error”. FIL MAX 'JCL ERROR'. Below screen print gives the only RC=JCL error
spool jobs. Other than this some other filter commands are,
FIL MAX NE ‘RC 0000’
FIL MAX EQ ‘RC 0000’
 Purging the spool jobs
Using the following option we can able to purge the unwanted spool jobs.
Below is the spool jobs in ideal case.
After applying over the jobs it will not exist in spool.
 Selecting a job in spool
To get the particular job from the list of job which is in the spool.
This command will gives the list as per the specification.
Pre (jobname); owner (mainframe id)
It will give the selective jobs as per the specifications.

************END************

Você também pode gostar