|
|
| Author |
Message |
SJanani
New User
Joined: 21 Mar 2008 Posts: 3 Location: Chennai
|
|
|
|
Hi!!!
I have a VB input file which contains duplicate records.All these duplicate records must be eliminated that is the first occurrence of the duplicate record must also get eliminated from my output file.For eg.
IN1:
0183940450
2840055588
1723945040
0183940450
3737485495
2758494505
2744945005
2748945990
0183940450
1723945040
My output must be as follows:
2840055588
3737485495
2758494505
2744945005
2748945990
Is this possible using DFSORT????? |
|
| Back to top |
|
 |
References
|
Posted: Fri Apr 04, 2008 10:45 am Post subject: Re: Eliminating duplicate records in a VB file |
 |
|
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 3900 Location: San Jose, CA
|
|
|
|
Here's a DFSORT/ICETOOL job that will do what you asked for. Since you want the records in their original order (rather than in sorted order), you need an extra pass over the data.
| Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file (VB)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=... output file (VB)
//TOOLIN DD *
SELECT FROM(IN) TO(T1) ON(13,10,CH) NODUPS USING(CTL1)
SORT FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
INREC BUILD=(1,4,5:SEQNUM,8,ZD,13:5)
/*
//CTL2CNTL DD *
SORT FIELDS=(5,8,ZD,A)
OUTREC BUILD=(1,4,5:13)
/*
|
|
|
| Back to top |
|
 |
SJanani
New User
Joined: 21 Mar 2008 Posts: 3 Location: Chennai
|
|
|
|
| Is it possible to do this duplicates elimination using DFSORT without ICETOOL. |
|
| Back to top |
|
 |
Anuj D.
Senior Member
Joined: 22 Apr 2006 Posts: 1242 Location: Mumbai, India
|
|
|
|
Well,
DFSORT's ICETOOL is a fully documented, fully supported feature of DFSORT, if I'm not mistaken ICETOOL has been with DFSORT since 1991. If you can use DFSORT you can use ICETOOL. Below link might provide a better understanding of ICETOOL
http://www.ibmmainframes.com/viewtopic.php?t=3308&highlight=dfsort+icetool
BTW is there any business reason behind
| Quote: |
| to do this duplicates elimination using DFSORT without ICETOOL. |
|
|
| Back to top |
|
 |
SJanani
New User
Joined: 21 Mar 2008 Posts: 3 Location: Chennai
|
|
|
|
Hi,
We dont have permissions to use ICETOOL to install jobs in production.
Thats why i am asking in DFSORT.
Thanks |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 3900 Location: San Jose, CA
|
|
|
|
SJanani,
You could use this two step DFSORT job:
| Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//SYSIN DD *
INREC BUILD=(1,4,5:C'00000001',13:SEQNUM,8,ZD,21:5)
SORT FIELDS=(21,10,CH,A)
SUM FIELDS=(5,8,ZD)
OUTFIL OMIT=(5,8,ZD,GT,+1)
/*
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&&T1,DISP=(OLD,PASS)
//SORTOUT DD DSN=... output file
//SYSIN DD *
SORT FIELDS=(13,8,ZD,A)
OUTREC BUILD=(1,4,5:21)
/*
|
However ...
DFSORT's ICETOOL is an extension of DFSORT that allows you to do many tasks more easily than you can using DFSORT alone as in this case. So I can't imagine why the people at your site are forcing you to do it with DFSORT instead of with DFSORT's ICETOOL.
Your site's license for DFSORT includes ICETOOL, so why wouldn't they want to take advantage of it? ICETOOL HAS been a part of DFSORT since 1991. It is proven technology and after having been around for almost two decades is certainly not new or risky. I'd suggest you ask whoever it is who says you can't use it what their justification is for not getting the most out of a product they're paying good money for. You can point them to the complete documentation of DFSORT's ICETOOL on IBM's official publications website at:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/6.0?DT=20060615185603
to prove that DFSORT's ICETOOL is fully documented. |
|
| Back to top |
|
 |
|
|
|