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
 

 

Need to Extract only the unmatched records from 2 files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Need to Extract only the unmatched records from 2 files
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 Moderator


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

PostPosted: Wed Aug 23, 2006 8:21 pm    Post subject:
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    Post subject: Re: Need to Extract only the unmatched records from 2 files
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    Post subject:
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 Moderator


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

PostPosted: Fri Aug 25, 2006 7:55 pm    Post subject:
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    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 Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
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


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