Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Remove Duplicates and ....

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Fri Jul 31, 2009 8:12 pm    Post subject: Remove Duplicates and ....
Reply with quote

I have a small requirement:

File1:
Length = 9



File2:

Length = 127
Field1|Field2|Field3|.....
Field2 starts from position 14 (which is same as in File1)


Requirement is:

1) To remove the duplicates in File 1
2) To retrieve the records into a new file File3 from File2
where Field2 in File2 = File1

Regards,
Kranthi.
Back to top
View user's profile Send private message

mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Fri Jul 31, 2009 8:17 pm    Post subject: hi
Reply with quote

Below are the examples for the above requirement!

File1:

36186CAN3
31566BAN3
36186CAN3
31566BAN3

File2:


0121708DLMS1¦36186CAN3¦50020908¦12285664¦S¦840
0121708DLNR1¦36186CAN3¦50020908¦12285664¦S¦840
0121708OXG91¦36186CAN3¦50020908¦12285664¦S¦840
0123704OXG91¦01F062432¦70305073¦01021898¦S¦840
031070H31BF1¦31412MHF8¦70305065¦10346548¦B¦840


File2 may contain the duplicates. For every record in File1, I need all records in File2.

Output looks like:



0121708DLMS1¦36186CAN3¦50020908¦12285664¦S¦840
0121708DLNR1¦36186CAN3¦50020908¦12285664¦S¦840
0121708OXG91¦36186CAN3¦50020908¦12285664¦S¦840
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Jul 31, 2009 9:56 pm    Post subject: Reply to: Remove Duplicates and ....
Reply with quote

mkk157,

The following DFSORT/ICETOOL JCL will give you the desired results.

Code:

//STEP0100 EXEC PGM=ICETOOL         
//TOOLMSG  DD SYSOUT=*             
//DFSMSG   DD SYSOUT=*             
//I1       DD DSN=your input 9 byte file,DISP=SHR
//I2       DD DSN=your input 127 byte file,DISP=SHR
//T1       DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(X,Y),RLSE)       
//OUT      DD SYSOUT=*                                               
//TOOLIN   DD *                                                     
  SORT FROM(I1) USING(CTL1)                                         
  COPY FROM(I2) USING(CTL2)                                         
  SORT FROM(T1) USING(CTL3)                                         
//CTL1CNTL DD *                                                     
  SORT FIELDS=(1,9,CH,A)                                             
  SUM FIELDS=NONE                                                   
  OUTFIL FNAMES=T1,BUILD=(14:1,9,128:C'$')                           
//CTL2CNTL DD *                                                     
  OUTFIL FNAMES=T1,OVERLAY=(128:X)                                   
//CTL3CNTL DD *                                                     
  SORT FIELDS=(14,9,CH,A),EQUALS                                     
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(129:SEQNUM,8,ZD,RESTART=(14,9))),
  IFTHEN=(WHEN=GROUP,BEGIN=(129,8,ZD,EQ,1),PUSH=(128:128,1))         
  OUTFIL FNAMES=OUT,BUILD=(1,127),                                   
  INCLUDE=(128,1,CH,EQ,C'$',AND,129,8,ZD,GT,1)                       
//*
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 Remove junk values in a file and rite... KP1125 DFSORT/ICETOOL 2 Wed Jan 25, 2017 9:58 pm
No new posts Sort Card to Remove Duplicate records... raj4neo SYNCSORT 2 Wed Jan 25, 2017 4:44 am
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Updating the counters after eliminati... PANDU1 DFSORT/ICETOOL 12 Mon Nov 21, 2016 9:47 am
No new posts Remove Special Characters from Mainfr... Rodger Zhang All Other Mainframe Topics 6 Wed Jul 06, 2016 1:12 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us