View previous topic :: View next topic
|
Author |
Message |
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
I have two flat files (RECFM=FB, LRECL=80) with data to be compared on 1st 8 bytes.
1st file:
Code: |
----+----1
ABCDEF12
BCDEFG11
CDEFGH13
DEFGHI10
|
2nd file:
Code: |
----+----1----+----2----+----3
ABCDEF13 kourt heavens
BCDEFG10 mathew hasiln
CDEFGH12 chand talborek
EFGHIJ14
|
My requirement is to compare two files on 1st 8 bytes and write matching records from 2nd file into a new file. Unfortunately, first 6 bytes only match here but I need digits from 7th and 8th columns from 1st file but rest of record from 2nd file (1st 6 bytes and info from 10th column) into my output file.
Expected Output:
Code: |
ABCDEF12 kourt heavens
BCDEFG11 mathew hasiln
CDEFGH13 chand talborek
|
Thanks in advance. Please help. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Why not match only the first 6 bytes in both files ??
What is stopping you in doing that??
In reformat pick first 8 bytes from File1 and the rest from File2 |
|
Back to top |
|
|
ramsri
Active User
Joined: 18 Oct 2008 Posts: 380 Location: India
|
|
|
|
thanks for the idea.....got the results |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You on Syncsort now ramsri? |
|
Back to top |
|
|
|