Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Eliminating duplicate records in a VB file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Eliminating duplicate records in a VB file
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 Moderator


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

PostPosted: Fri Apr 04, 2008 9:28 pm    Post subject:
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    Post subject: Reply to: Eliminating duplicate records in a VB file
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

Senior Member


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

PostPosted: Sat Apr 26, 2008 11:34 am    Post subject:
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

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
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    Post subject: Reply to: Eliminating duplicate records in a VB file
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 Moderator


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

PostPosted: Sun Apr 27, 2008 10:45 pm    Post subject:
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:

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 0 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us