IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Eliminating duplicate records in a VB file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
SJanani

New User


Joined: 21 Mar 2008
Posts: 3
Location: Chennai

PostPosted: Fri Apr 04, 2008 10:45 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Apr 04, 2008 9:28 pm
Reply with quote

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
View user's profile Send private message
SJanani

New User


Joined: 21 Mar 2008
Posts: 3
Location: Chennai

PostPosted: Sat Apr 26, 2008 9:03 am
Reply with quote

Is it possible to do this duplicates elimination using DFSORT without ICETOOL.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Sat Apr 26, 2008 11:34 am
Reply with quote

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

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
View user's profile Send private message
SJanani

New User


Joined: 21 Mar 2008
Posts: 3
Location: Chennai

PostPosted: Sat Apr 26, 2008 11:54 am
Reply with quote

Hi,

We dont have permissions to use ICETOOL to install jobs in production.
Thats why i am asking in DFSORT.

Thanks
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sun Apr 27, 2008 10:45 pm
Reply with quote

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:

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Duplicate transid's declared using CEDA CICS 3
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top