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
 

 

Copy from two files.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Copy from two files.
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

Moderator


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

PostPosted: Thu Sep 06, 2012 4:50 pm    Post subject:
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    Post subject: Reply to: Copy from two files.
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7306

PostPosted: Thu Sep 06, 2012 8:18 pm    Post subject: Reply to: Copy from two files.
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am


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