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

Match record frm 1 file to another file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Thu Mar 08, 2007 6:15 pm
Reply with quote

I have three input files

First four bytes is KEY Field.......

File1
----
E001 shank tttt
E002 deep rrrr
E003 reen gggg
.
File2
----
E002 dddd rrrr
E003 eeee gggg
.
File3
-----
E003 tttt yyyy
.
Ouput supposed to be

Output file
--------
E001 shank tttt
E002 deep rrrr
E002 dddd rrrr
E003 reen gggg
E003 eeee gggg
E003 tttt yyyy

I came to know that we can do this with ICETOOL splice option.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Mar 08, 2007 6:23 pm
Reply with quote

ibmmainframesyntel, you're not splicing anything. All you're doing is concatenating three files into one, sorted by the key field.
Back to top
View user's profile Send private message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Thu Mar 08, 2007 7:20 pm
Reply with quote

IF the key field (first four bytes) from file1 doesn't match,
then the respective key matching from file2 and file3 should not be in the ouput file.
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: Thu Mar 08, 2007 9:59 pm
Reply with quote

Your example doesn't illustrate what you say you want since the keys in file2 and file3 all have matches in file1. Please show a better example where records are dropped from the output file. Also, what is the RECFM and LRECL of your input files?
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: Thu Mar 08, 2007 10:17 pm
Reply with quote

I think you asked essentially the same question with a better example at:

ibmmainframes.com//viewtopic.php?t=18747

and I answered it there.
Back to top
View user's profile Send private message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Fri Mar 09, 2007 10:28 am
Reply with quote

First two byte is a key field

The respective record which matches the key field
from input-1 to Input-2 and Input-3 should be in output file.


Input-1
--------

E1 first file record
E3 first file record
E4 first file record
E6 first file record

Input-2
-------

E1 second file record
E2 second file record
E3 second file record
E3 second file record DUp



Input-3
-------

E3 third file record
E4 third file record
E5 third file record

Ouput
-----
E1 first file record
E1 second file record
E3 first file record
E3 second file record
E3 second file record Dup
E3 third file record
E4 first file record
E4 third file record
E6 first file record

"E2 second file record "
is not in the output file
coz no respective key field in Input-1

"E5 third file record"
is not in the output file
coz no respective key field in Input-1

The key 'E3' matches in all the file
so respective records are concatinated according to that..

Pls let me knw...

hope u understood..
Back to top
View user's profile Send private message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Fri Mar 09, 2007 11:47 am
Reply with quote

Ignore the previous Format which i submitted

consider this one...

First two byte is a key field

The respective record which matches the key field
from input-1 to Input-2 and Input-3 should be in output file.


Input-1
--------

E1 first file record
E3 first file record
E4 first file record
E6 first file record

Input-2
-------

E1 second file record
E2 second file record
E3 second file record
E3 second file record DUp



Input-3
-------

E3 third file record
E4 third file record
E5 third file record

Ouput
-----
T1 E1 first file record
T2 E1 second file record
T1 E3 first file record
T2 E3 second file record
T2 E3 second file record Dup
T3 E3 third file record
T1 E4 first file record
T3 E4 third file record
T1 E6 first file record

First file record should be prefix with 'T1' in the output
Second file record should be prefix with 'T2' in the output
third file record should be prefix with 'T3' in the output

My record length is 150
Recfm is FB


"E2 second file record "
is not in the output file
coz no respective key field in Input-1

"E5 third file record"
is not in the output file
coz no respective key field in Input-1

The key 'E3' matches in all the file
so respective records are concatinated according to that..

Pls let me knw...

hope u understood..
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 Mar 09, 2007 9:14 pm
Reply with quote

Closed - duplicate
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. 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 0
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top