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

Need to compare records of 2 files


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

New User


Joined: 17 Oct 2008
Posts: 10
Location: Pune

PostPosted: Thu Oct 15, 2009 3:11 am
Reply with quote

hi i have 2 files: File1 and File2

The records present in file1:
9600000000
9700000000
9800000000

The records present in file2:
9400000000
9500000000
9600000000
9700000000

I want the output in 3rd file as
9700000000
9800000000

i.e The duplicates present in the 2 files and

In forth file i need the non duplicates

please help me with the sort.

Thanks
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Oct 15, 2009 3:22 am
Reply with quote

zavedali85,

Your output does NOT match your requirements. How did 9800000000 be in the output as a duplicate? It is only present in file1.

Answer the following questions

1. What is the LRECL & RECFM of the input file 1
2. What is the Key position and format in input file 1
3. Do you have duplicates on the key in file1?


4. What is the LRECL & RECFM of the input file 2
5. What is the Key position and format in input file 2
6. Do you have duplicates on the key in file2?


7. What is the LRECL and RECFM of output files?
8. Show us an example of input and desired output
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Oct 15, 2009 3:23 am
Reply with quote

Hi,

are there duplicates in either file ?

what are the matching keys ?


What is the RECFM and LRECL ?


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

New User


Joined: 17 Oct 2008
Posts: 10
Location: Pune

PostPosted: Thu Oct 15, 2009 3:28 am
Reply with quote

sorry..

it was a typo:

The output i am looking in the 3rd file is
9600000000
9700000000

file1:
Record format . . . : FB
Record length . . . : 100

file2
Record format . . . : FB
Record length . . . : 100



Key postion in file1:
1-10

Key postion in file2:
1-10

For output files file3 and file4
Record format . . . : FB
Record length . . . : 100


We dont have duplicates in either files.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Oct 15, 2009 3:35 am
Reply with quote

zavedali85,

use the following DFSORT/ICETOOL JCL

Code:

//STEP0100 EXEC PGM=ICETOOL         
//TOOLMSG  DD SYSOUT=*               
//DFSMSG   DD SYSOUT=*               
//IN       DD DSN=Your 100 byte file1,DISP=SHR
//         DD DSN=Your 100 byte file2,DISP=SHR
//OUT1     DD SYSOUT=*                                               
//OUT2     DD SYSOUT=*                                               
//TOOLIN   DD *                                                       
SELECT FROM(IN) TO(OUT1) ON(1,10,CH) ALLDUPS DISCARD(OUT2) USING(CTL1)
//CTL1CNTL DD *                                                       
  OUTFIL FNAMES=OUT1,REMOVECC,NODETAIL,                               
  SECTIONS=(1,10,HEADER3=(1,100))                                     
  OUTFIL FNAMES=OUT2                                                 
//*
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 Write line by line from two files DFSORT/ICETOOL 7
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 Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
Search our Forums:

Back to Top