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
 

 

Writting unmatched records

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

New User


Joined: 06 May 2008
Posts: 90
Location: Chennai

PostPosted: Tue Oct 06, 2009 10:59 am    Post subject: Writting unmatched records
Reply with quote

There are two sequential files, having few records in common (exactly identical). The requirement is to
a) merge the two files into a new file,
b) keep only non-common records in the new file.
E.g. say FILE A has 50 records, FILE B has 100 records and 25 records are common. You need to create a new file, say FILE3, which should have the non-common 100 records (25 from FILE1 + 75 from FILE2).

What would you do this using SORT / ICETOOL?

Note:
1. The file structures are same.
2. You may use more than one sort steps to achieve it.

Can u suggest some logic.
Back to top
View user's profile Send private message

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Tue Oct 06, 2009 11:10 am    Post subject:
Reply with quote

Hi,

are there duplicate records in File A and File B ?


Gerry
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 90
Location: Chennai

PostPosted: Tue Oct 06, 2009 11:15 am    Post subject: Reply to: Writting unmatched records
Reply with quote

There are only 25 matching records in both files remainig are unique
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Tue Oct 06, 2009 11:21 am    Post subject:
Reply with quote

Hi,

try this
Code:
//STEP0001 EXEC  PGM=ICETOOL                               
//TOOLMSG  DD SYSOUT=*                                     
//DFSMSG   DD SYSOUT=*                                     
//IN       DD DSN=file1                                   
//         DD DSN=file2                                   
//UNMATCH  DD SYSOUT=*                                     
//TOOLIN   DD *                                             
SELECT FROM(IN) TO(UNMATCH) ON(1,80,CH) NODUPS             
/*


I've assumed the file is FB and LRECL is 80


Gerry
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: Tue Oct 06, 2009 8:48 pm    Post subject:
Reply with quote

scorp,

Gerry's solution will work for the situation you described. Just use the correct ON(p,m,f) operand (starting position, length and format) for the key you want to use to check for duplicates.

For more information on using DFSORT's ICETOOL for various matching operations, see the "Create files with matching and non-matching records" Smart DFSORT Trick at:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000094
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 90
Location: Chennai

PostPosted: Wed Oct 07, 2009 11:31 am    Post subject: Reply to: Writting unmatched records
Reply with quote

Thanks a lot Frank and Gerry for inputs
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 Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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