Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 1547
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: 7314

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 Comparing two sequential files Mohan Kothakota COBOL Programming 14 Mon Apr 16, 2018 6:35 pm
No new posts SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am
No new posts How to build one file from two input ... daniele DFSORT/ICETOOL 5 Tue Feb 27, 2018 6:45 pm
No new posts Image copy after Online reorganization. lind sh IMS DB/DC 0 Tue Jan 30, 2018 9:58 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us