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

Copy from two files.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Thu Sep 06, 2012 4:34 pm
Reply with quote

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
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu Sep 06, 2012 4:50 pm
Reply with quote

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
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Thu Sep 06, 2012 6:28 pm
Reply with quote

thanks for the idea.....got the results icon_biggrin.gif
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Sep 06, 2012 8:18 pm
Reply with quote

You on Syncsort now ramsri?
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts VB to VB copy - Full length reached SYNCSORT 8
Search our Forums:

Back to Top