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

Writting unmatched records


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

New User


Joined: 06 May 2008
Posts: 96
Location: Delhi

PostPosted: Tue Oct 06, 2009 10:59 am
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: 1702
Location: Australia

PostPosted: Tue Oct 06, 2009 11:10 am
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: 96
Location: Delhi

PostPosted: Tue Oct 06, 2009 11:15 am
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: 1702
Location: Australia

PostPosted: Tue Oct 06, 2009 11:21 am
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 Developer


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

PostPosted: Tue Oct 06, 2009 8:48 pm
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:

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: 96
Location: Delhi

PostPosted: Wed Oct 07, 2009 11:31 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
No new posts JCL sortcard to print only the records DFSORT/ICETOOL 11
Search our Forums:

Back to Top