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

Retrieving matched duplicate records


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 83
Location: Bangalore

PostPosted: Wed Apr 11, 2007 5:48 pm
Reply with quote

Hi,
I have the following requirement

File 1

Key Value
42 9876
43 7654
44 5432

File 2

Key Value
42 9876
43 7654
44 5432

The output file should be

42 9876 7654
42 9876 5432
43 7654 9876
43 7654 5432
44 5432 9876
44 5432 7654

Currently I am using the matched function of Easytrieve which doesnot help me to get the above result.

I get the result as
42 9876 7654
43 7654 9876

If anybody knows the solution please help me out
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Apr 11, 2007 6:13 pm
Reply with quote

How do you get "Retrieving matched duplicate records" out of this:
42 9876 7654
42 9876 5432
43 7654 9876
43 7654 5432
44 5432 9876
44 5432 7654
?
Define the rules for your "match".
Back to top
View user's profile Send private message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 83
Location: Bangalore

PostPosted: Wed Apr 11, 2007 6:36 pm
Reply with quote

Sorry the desceiption above is wrong

File1
Key Value
42 9876
42 7654
42 5432

File2
Key Value
42 9876
42 7654
42 5432

Output expected
42 9876 7654
42 9876 5432
42 7654 9876
42 7654 5432
42 5432 9876
42 5432 7654

Sorry for the mistake
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Apr 11, 2007 6:53 pm
Reply with quote

William Thompson wrote:
How do you get "Retrieving matched duplicate records" out of this:
42 9876 7654
42 9876 5432
42 7654 9876
42 7654 5432
42 5432 9876
42 5432 7654
?
Define the rules (using words and sentences) for your "match".
Back to top
View user's profile Send private message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 83
Location: Bangalore

PostPosted: Wed Apr 11, 2007 7:21 pm
Reply with quote

If the key in file1 matches with the one or more records in file2 then display the key of file1 with the combination of value in file2

ie if file1 has a key 42 and value 10
file 2 has 2 records with key 42 but different values. then we need to display

file1_key(42) file1_value(10) file2_value
file1_key(42) file1_value(10) file2_value

Does this explain....
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Apr 11, 2007 9:00 pm
Reply with quote

Not being much of an EZT person - though it does have some nice key matching capabilities - I can't see how to do this without have the file inputting twice at the same time - or the original and a copy.

Keying off the first, read a record, scan the second for key matches, ignore if value equal and write if key equal and number not.
When the second file at ends (or key break if sorted) close and open the second file and repeat.
Back to top
View user's profile Send private message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 83
Location: Bangalore

PostPosted: Wed Apr 11, 2007 9:21 pm
Reply with quote

I tried closing the file and re-opening it but that didn't work

Could you put a small code snippet of how u would do it where it is a PS file.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Apr 11, 2007 9:29 pm
Reply with quote

You got to realize that there is no open/close in EZT and ps files can't be repositioned.
Like I said before, you have to approach this from a different direction.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Apr 11, 2007 11:09 pm
Reply with quote

Both this and the other post sound right up the alley for a DFSORT process for record matching, providing that Huzefa has DFSORT available.
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 -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Duplicate transid's declared using CEDA CICS 3
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
Search our Forums:

Back to Top