Monday, October 1, 2007

Dinosaurs - JCL - Allocate a VSAM in JCL without IDCAMS

Hi
This week I have just compiled a few JCL tips and tricks. You can find a copy of this article in http://ctsdinos.blogspot.com
Also I would like to remind you that , this is an open forum . Everybody is welcome to discuss any topic on Mainframes. You can also use this forum to discuss any issues that you are currently facing in the project.

1. Allocate VSAM datasets in JCL without IDCAMS
//NEWVSAM EXEC PGM=IEFBR14
//DD1 DD DSN=BKTEST.W.CTS047.ST.CL, <>
// DISP=(,CATLG,DELETE),
// RECORG=KS,LRECL=80,
// KEYLEN=24,KEYOFF=0,UNIT=SYSDA,SPACE=(CYL,(5,5))
//SYSOUT DD SYSOUT=D
//SYSPRINT DD SYSOUT=D

२. Split a single sequential file into PDS members
//S5 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD *
1
END
2
END
3
/*
//SYSUT2 DD DSN=ADCF74C.TEST.IEBGENER,
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=27920),
// SPACE=(TRK,(55,5,10),RLSE),BUFNO=20,
// DISP=(NEW,CATLG),UNIT=SYSDA
//SYSIN DD *
GENERATE MAXNAME=3,MAXGPS=2
MEMBER NAME=TEST01
GROUP1 RECORD IDENT=(1,'END',3)
MEMBER NAME=TEST02
GROUP2 RECORD IDENT=(1,'END',3)
MEMBER NAME=TEST03
The above JCL will allocate a PDS ADCF74C.TEST.IEBGENER and Will split the Input data based on the occurence of character END and will put the data in three new members TEST01, TEST02 and TEST03
Member TEST01 will contain the following 2 records
1
END
Member TEST02 will contain the following 2 records
2
END
Member TEST03 will contain the following 1 record
3

3. Never do a Sort and Repro in two different steps
I have seen some Jobs where a file is sorted and reproed to a VSAM file. This is expensive
Sort can be used in place of IDCAMS for Repro .So if you want to sort file F1 and load to a VSAM file V1 do it in the same step

//SORT EXEC PGM=SORT
//SORTIN DD DSN=F1,DISP=SHR
//SORTOUT DD DSN=V1,DISP=SHR
//SYSIN DD *
SORT FIELDS=(5,20)
/*
//SYSOUT DD SYSOUT=*


Questions/Suggestions/Comments - Please forward it to Balaji / Myself
Thanks
P Sundar

Labels:


Comments: Post a Comment

Subscribe to Post Comments [Atom]





<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]

Web Counters
HTML Counter