View previous topic :: View next topic
Author
Message
divya_maddi New User Joined: 03 Nov 2005Posts: 33
IN1: File 1 has following records
1 1 1
1 1 2
3 1 1
4 1 5
6 1 1
7 1 3
7 1 4
7 1 5
8 1 9
IN2: File 2
2
6
7
8
OUT12: Now Outfile 1 should have
6 1 1
7 1 3
7 1 4
7 1 5
8 1 9
OUT1: Outfile 2 should have
1 1 1
1 1 2
3 1 1
4 1 5
please help... i tried using icetool as follows, but it is removing duplicates in the OUT1 file:
Code:
//T1 DD DSN=&&T1,DISP=(MOD,PASS),UNIT=SYSDA,SPACE=(TRK,(5,5))
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL2)
COPY FROM(IN2) TO(T1) USING(CTL1)
SPLICE FROM(T1) TO(OUT12) KEEPNODUPS WITH(21,1) -
WITHALL WITH(21,1) WITH(1,1) ON(1,2,CH)
/*
//CTL1CNTL DD *
OUTREC FIELDS=(1,15,20:C'11')
/*
//CTL2CNTL DD *
OUTREC FIELDS=(1,10,20:C'22')
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT12,INCLUDE=(20,2,CH,EQ,C'21'),OUTREC=(1:1,15,133:X)
OUTFIL FNAMES=OUT1,INCLUDE=(20,2,CH,EQ,C'11'),OUTREC=(1:1,20,133:X)
/*
Back to top
murmohk1 Senior Member Joined: 29 Jun 2006Posts: 1436 Location: Bangalore,India
divya,
We expect some exaplanation regarding your requirement. Please remember its not possible for most of us to go trhu sort card and get the requirement.
Back to top
divya_maddi New User Joined: 03 Nov 2005Posts: 33
if the record is present in both input file 1 and 2 then write file1 record to outfile1 else write to outfile2. Note that outfile1 has duplicates and they need to be written in the output files.
Back to top
divya_maddi New User Joined: 03 Nov 2005Posts: 33
note that i have searched the dfsort/icetool forum but did not find any sample for this case..... none of them write the eliminated records to another file.... and most of them do not deal with duplicates.
Back to top
divya_maddi New User Joined: 03 Nov 2005Posts: 33
divya_maddi wrote:
if the record is present in both input file 1 and 2 then write file1 record to outfile1 else write to outfile2. Note that outfile1 has duplicates and they need to be written in the output files.
small correction. The key is the first byte and it is enough if the 1st byte of file 1 and 2 match to write to the outfile1
Back to top
krisprems Active Member Joined: 27 Nov 2006Posts: 649 Location: India
Code:
//STEP001 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
1 1 1
1 1 2
1 1 2
3 1 1
4 1 5
6 1 1
7 1 3
7 1 4
7 1 5
8 1 9
/*
//IN2 DD *
2
6
7
8
/*
//TMP1 DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//MATCH DD SYSOUT=*
//UNMATCH DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN2) TO(TMP1) USING(CP01)
COPY FROM(IN1) TO(TMP1) USING(CP02)
SPLICE FROM(TMP1) TO(MATCH) ON(1,1,CH) WITH(2,9) WITH(13,1) -
WITHALL KEEPBASE USING(CP03) KEEPNODUPS
/*
//CP01CNTL DD *
OUTREC BUILD=(1,10,12:C'11')
/*
//CP02CNTL DD *
OUTREC BUILD=(1,10,12:C'22')
/*
//CP03CNTL DD *
OUTFIL FNAMES=MATCH,INCLUDE=(12,2,CH,EQ,C'12'),BUILD=(1,10,133:X)
OUTFIL FNAMES=UNMATCH,INCLUDE=(12,2,CH,EQ,C'22'),BUILD=(1,10,133:X)
/*
MATCH contains
Code:
6 1 1
7 1 3
7 1 4
7 1 5
8 1 9
UNMATCH contains
Code:
1 1 1
1 1 2
1 1 2
3 1 1
4 1 5
Back to top
divya_maddi New User Joined: 03 Nov 2005Posts: 33
thank you very much krisprem..... works perfectly
Back to top
Please enable JavaScript!