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
 

 

Match record frm 1 file to another file

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Match record frm 1 file to another file
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

Moderator Team Head


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

PostPosted: Thu Mar 08, 2007 6:23 pm    Post subject: Re: Match record frm 1 file to another file
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    Post subject:
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 Moderator


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

PostPosted: Thu Mar 08, 2007 9:59 pm    Post subject:
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 Moderator


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

PostPosted: Thu Mar 08, 2007 10:17 pm    Post subject:
Reply with quote

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

http://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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Fri Mar 09, 2007 9:14 pm    Post subject:
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.    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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm


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