28
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)

Session on JCL Utilities

Embed Size (px)

Citation preview

Page 1: Session on JCL Utilities

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

FASTDELThis 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

Page 2: Session on JCL Utilities

Alternate way to compress a PDS, here is the screen print to Zip in simple way.

Below screen prints shows the PDS after compressing,

Page 3: Session on JCL Utilities

Defining GDG base using TSO OptionType 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,

Page 4: Session on JCL Utilities

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,

Page 5: Session on JCL Utilities

After giving the base name it will ask for number of generations too,

Page 6: Session on JCL Utilities

A GDG base is created with one line TSO command,

Page 7: Session on JCL Utilities

Sort operation without using ProgramInstead 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

Page 8: Session on JCL Utilities

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

Page 9: Session on JCL Utilities

The below screen shots gives you the sorted order on voucher line number basis,

Page 10: Session on JCL Utilities

Below screen prints shows the difference in the 22nd position,

Page 11: Session on JCL Utilities

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

Page 12: Session on JCL Utilities

The following screen shots list the last 25 TSO commands used….

Page 13: Session on JCL Utilities

SORT CHANGEDIt'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.

Page 14: Session on JCL Utilities

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.

Page 15: Session on JCL Utilities

NRETRIEVRetrieving 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.

Page 16: Session on JCL Utilities

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 datasetThis 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/*

Page 17: Session on JCL Utilities

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”

Page 18: Session on JCL Utilities

Below screen shot gives the same file in edit mode even saving the data is also possible.

Page 19: Session on JCL Utilities

Thru edit mode saving the VSAM file is also possible.

VSAMEMT=YESTo 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/*

Page 20: Session on JCL Utilities

Filtering the spool jobs

TO filter the spool jobs as per the return code. Below is the screen prints for the ideal case.

Page 21: Session on JCL Utilities

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’

Page 22: Session on JCL Utilities

Purging the spool jobsUsing the following option we can able to purge the unwanted spool jobs. Below is the spool jobs in ideal case.

Page 23: Session on JCL Utilities

After applying over the jobs it will not exist in spool.

Page 24: Session on JCL Utilities

Selecting a job in spoolTo 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************