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: 1542
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 Compare and COPY using DFSORT pshongal DFSORT/ICETOOL 3 Fri Nov 17, 2017 9:49 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts Copy selected columns from 2 input fi... Poha Eater DFSORT/ICETOOL 3 Thu Nov 02, 2017 3:43 pm
No new posts Finding difference between two PS fil... Vignesh Sid SYNCSORT 5 Mon Oct 30, 2017 1:13 pm
No new posts NDM 300 files from mainframe to linux shreya19 All Other Mainframe Topics 2 Thu Oct 26, 2017 11:40 am

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