nguyenh Beginner
Joined: 09 Mar 2004 Posts: 52 Topics: 6
|
Posted: Mon Jan 24, 2005 5:26 pm Post subject: |
|
|
Hi all,
Which all the helps you provided, I got the skeleton works as desired.
Below is a working skeleton, I am wondering if there is a cleaner, shorter way that provides the same result? just for your reference the DSN1 contains 1, or 2 and DSN2 contains "NEWOUTLIST", or "OLDOUTLIST"
you should not worry about those variables. Thank you much!
Code: |
//**********************************************************************
//*RUN ICETOOL UTILITY TO CONSTRUCT SORT KEYS THEN SORT THE RECORDS
//**********************************************************************
//SORT&DSN1 EXEC PGM=ICETOOL,REGION=512K
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//IPFILE DD DSN=&USERID..TEMP&DSN1,DISP=SHR
//OPFILE DD DSN=&USERID..&DSN2,DISP=(OLD,KEEP)
//HEADER DD DSN=&&HEADER,
// DISP=(NEW,PASS),SPACE=(CYL,(10,20),RLSE)
//DETAIL DD DSN=&&DETAIL,
// DISP=(NEW,PASS),SPACE=(CYL,(10,20),RLSE)
//COMBIN DD DSN=*.HEADER,VOL=REF=*.HEADER,DISP=OLD
// DD DSN=*.DETAIL,VOL=REF=*.DETAIL,DISP=OLD
//TEMP1 DD DSN=&&T1,
// DISP=(NEW,PASS),SPACE=(CYL,(10,20),RLSE)
//TEMP2 DD DSN=&&T2,
// DISP=(NEW,PASS),SPACE=(CYL,(10,20),RLSE)
//TEMP3 DD DSN=&&T3,
// DISP=(NEW,PASS),SPACE=(CYL,(10,20),RLSE)
//TEMP4 DD DSN=&&T4,
// DISP=(NEW,PASS),SPACE=(CYL,(10,20),RLSE)
//TEMP5 DD DSN=*.TEMP3,VOL=REF=*.TEMP3,DISP=OLD
// DD DSN=*.TEMP4,VOL=REF=*.TEMP4,DISP=OLD
//TEMP6 DD DSN=&&T6,
// DISP=(NEW,PASS),SPACE=(CYL,(10,20),RLSE)
//TEMP7 DD DSN=&&T7,
// DISP=(NEW,PASS),SPACE=(CYL,(10,20),RLSE)
//TEMP8 DD DSN=&&T8,
// DISP=(NEW,PASS),SPACE=(CYL,(10,20),RLSE)
//TEMP9 DD DSN=&&T9,
// DISP=(NEW,PASS),SPACE=(CYL,(10,20),RLSE)
//TEMP10 DD DSN=&&T10,
// DISP=(NEW,PASS),SPACE=(CYL,(10,20),RLSE)
//TEMP11 DD DSN=*.TEMP6,VOL=REF=*.TEMP6,DISP=OLD
// DD DSN=*.TEMP7,VOL=REF=*.TEMP7,DISP=OLD
// DD DSN=*.TEMP8,VOL=REF=*.TEMP8,DISP=OLD
// DD DSN=*.TEMP9,VOL=REF=*.TEMP9,DISP=OLD
// DD DSN=*.TEMP10,VOL=REF=*.TEMP10,DISP=OLD
//TOOLIN DD *
COUNT FROM(IPFILE)
COPY FROM(IPFILE) USING(CTL1)
COPY FROM(COMBIN) USING(CTL2)
SPLICE FROM(TEMP1) TO(TEMP2) -
ON(87,8,CH) -
WITH(1,80) -
WITHALL USING(CTL3)
COPY FROM(TEMP2) USING(CTL4)
COPY FROM(TEMP5) USING(CTL5)
SORT FROM(TEMP11) USING(CTL6)
//CTL1CNTL DD *
INREC FIELDS=(1,80,SEQNUM,8,ZD)
OUTFIL FNAMES=HEADER,
INCLUDE=(1,1,CH,EQ,C'*'),
OUTREC=(1,80,8C'0',SEQNUM,8,ZD,C'H',39,6)
OUTFIL FNAMES=DETAIL,SAVE,
OUTREC=(1,88,SEQNUM,8,ZD,C'Z',6X)
//CTL2CNTL DD *
INREC FIELDS=(1,96,(81,8,ZD,SUB,89,8,ZD),M11,LENGTH=8,97,7)
OUTFIL FNAMES=TEMP1,
OUTREC=(1,80,106,6,97,8,89,8)
//CTL3CNTL DD *
OUTFIL FNAMES=TEMP2,
OUTREC=(1,86,SEQNUM,7,ZD)
//CTL4CNTL DD *
OUTFIL FNAMES=TEMP3,
INCLUDE=(1,1,CH,EQ,C' ',OR,
77,2,CH,EQ,C'TA',OR,
77,2,CH,EQ,C'TB',OR,
77,2,CH,EQ,C'TC'),
OUTREC=(1,93,2,4,10X)
OUTFIL FNAMES=TEMP4,SAVE,
OUTREC=(1,93,1,10,4X)
//CTL5CNTL DD *
OUTFIL FNAMES=TEMP6,
INCLUDE=(77,2,CH,EQ,C'TT'),
OUTREC=(1,103,11,4)
OUTFIL FNAMES=TEMP7,
INCLUDE=(77,2,CH,EQ,C'CA'),
OUTREC=(1,103,73,4)
OUTFIL FNAMES=TEMP8,
INCLUDE=(77,2,CH,EQ,C'FM'),
OUTREC=(1,103,4X)
OUTFIL FNAMES=TEMP9,
INCLUDE=(77,2,CH,EQ,C'DL'),
OUTREC=(1,103,1,4)
OUTFIL FNAMES=TEMP10,SAVE,
OUTREC=(1,103,4X)
//CTL6CNTL DD *
OPTION EQUALS
INREC FIELDS=(1,107)
SORT FIELDS=(81,6,CH,A,
94,10,CH,A,
77,2,CH,A,
104,4,CH,A,
79,2,CH,A,
87,7,CH,A)
OUTFIL FNAMES=OPFILE,
OUTREC=(1,86)
/*
|
|
|