View previous topic :: View next topic
|
Author |
Message |
Vijaya Kommuri
New User
Joined: 22 May 2009 Posts: 2 Location: Pune
|
|
|
|
Given a file I want to eliminate only those duplicate records on key which have specific value on a particular field.
suppose In the example given below first column is key. second column contain specific value .I want to elimiante only those duplicates on key with value 'C' in the second column.
Input :
---------
C1 A
C1 B
C1 C
C2 C
Expected Output:
---------------------
C1 A
C1 B
C2 C
Please provide solution
Regards
Vijaya |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
vijaya kommuri,
The following DFSORT/ICETOOL JCL will give you the desired results. I assumed your input LRECL to be 80 and FB recfm.
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
C1 A
C1 B
C1 C
C2 C
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,2,CH) ON(81,8,CH) FIRST USING(CTL1)
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(4,1,CH,EQ,C'C'),
OVERLAY=(81:81,8,ZD,SUB,+1,M11,LENGTH=8))
OUTFIL FNAMES=OUT,BUILD=(1,80)
/* |
|
|
Back to top |
|
|
gayathrinag
New User
Joined: 16 Oct 2008 Posts: 37 Location: chennai
|
|
|
|
Hi Skolusu,
I just tried the below sort and its working fine for the above.
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
C1 A
C1 B
C1 C
C2 C
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,2,CH) ON(3,1,CH) ALLDUPS
/*
Thanks |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
gayathrinag,
Did you even read the requirement? Did you see what you got as output and compare it against the original required output? I ran your job as is and this is what I got
if you look at the required output OP needs
Apart from that You are using ALLDUPS parm which would eliminate any unique records. If you want to post a solution please make sure that it works according to the requirements. |
|
Back to top |
|
|
|