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

Need to Extract only the unmatched records from 2 files


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

New User


Joined: 19 Jul 2006
Posts: 8

PostPosted: Wed Aug 23, 2006 5:06 pm
Reply with quote

Hi,
I have 2 files and the requirement is that I need to sort out all the unmatched records from 2 files based on the all records in the input file.

rest to sure that I want only the unmatched records from the I/P file-2 only in the output.

Like for Eg:
I/p file -1

aaaabbbcccc1
dddddeeeeff2

I/P file-2

dddddeeeee2
aaaabbbcccc1
cccggghhhhh2

O/P file

cccggghhhhh2


Can anybody help me out

Thanks
Sri
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: Wed Aug 23, 2006 8:21 pm
Reply with quote

In your limited example, you show no duplicates within file1, no duplicates within file2, and no records in file1 that don't have a match in file2. I can give you a simple solution for that case, but I suspect you'll come back and say "but that didn't work for this other situation". So:

1) Can file1 have duplicates within it, e.g.

I/P file - 1
aaaabbbcccc1
dddddeeeeff2
aaaabbbcccc1

2) Can file2 have duplicates within it, e.g.

dddddeeeee2
aaaabbbcccc1
cccggghhhhh2
aaaabbbcccc1

3) Can file1 have a record that is not in file2, e.g.

I/p file -1

aaaabbbcccc1
dddddeeeeff2
xxxxxxxxxxx

I/P file-2

dddddeeeee2
aaaabbbcccc1
cccggghhhhh2

If any of these situations are possible, then please show a more complete example of the records in the input file and what you want for the output records that covers all of the possible variations.

Also, state the RECFM and LRECL of the input files.
Back to top
View user's profile Send private message
Archana_MF

New User


Joined: 21 Jul 2006
Posts: 49
Location: California

PostPosted: Fri Aug 25, 2006 3:12 am
Reply with quote

For all the Scenarios listed by Frank EZtreive will be a easy Solution.
Check with ur team if anyone is using EZtreive or search forum for more details.
In my previous Project I used for matching/unmatching records, I will try to get some samples.
Back to top
View user's profile Send private message
senman

New User


Joined: 17 Aug 2006
Posts: 17
Location: Chennai

PostPosted: Fri Aug 25, 2006 1:19 pm
Reply with quote

Try this

//STEP010 EXEC PGM=ICETOOL
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=A7105AB.INPUT1,DISP=SHR
// DD DSN=A7105AB.INPUT2,DISP=SHR
/*
//SORTOUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(SORTIN) TO(SORTOUT) ON(1,12,ZD) NODUPS
/*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*

But I have a doubt if your i/p is typed wrongly... pls check
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: Fri Aug 25, 2006 7:55 pm
Reply with quote

Quote:
ON(1,12,ZD)


This won't work since the data is alphanumeric. CH or BI would work. But again, this only works for the case where there are no dups within file1, no dups within file2 and no records in file1 that don't have a match in file2 which is what I was trying to verify.

Quote:

//SYSOUT DD SYSOUT=*


This DD isn't needed and is ignored.

Quote:
But I have a doubt if your i/p is typed wrongl


I agree. dddddeeeeff2 in file1 does not actually match dddddeeeee2 in file2, but was probably meant to.
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 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
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
Search our Forums:

Back to Top