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

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

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

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 MXG - Processing Compressed DB2 SMF r... vasanthz All Other Mainframe Topics 2 Thu May 10, 2018 12:47 am
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am
No new posts add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 11 Thu Feb 22, 2018 5:37 pm

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