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

copy file 2 data into file1 for matched records


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
SUJEET06462

New User


Joined: 20 Sep 2016
Posts: 2
Location: India

PostPosted: Fri Jun 04, 2021 11:10 pm
Reply with quote

i have 2 files, 1st file lrecl : 1000, total records 100000. unique key: 1 to 20
2nd file: LRECL : 40, Total records 100, unique key 1 to 20
i want to merge file 2 to file1 in such a way that for matching records in file 1 and file 2 :
1) 21 : 40 data from file 2 should be copied to 61 :80 in file 1
2) all unmatched records in file 1 should remain unchanged.

output file should contain all records of file 1
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


Joined: 15 Aug 2015
Posts: 518
Location: Bamberg, Germany

PostPosted: Sat Jun 05, 2021 3:19 am
Reply with quote

Provide sample data for F1 and F2 and what you have tried so far. Make use of the code button (that works as a toggle) when providing code or data.

Remember that this is a help forum and not "do my job for me".
Back to top
View user's profile Send private message
sergeyken
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1084

PostPosted: Sat Jun 05, 2021 1:57 pm
Reply with quote

SUJEET06462 wrote:
i have 2 files, 1st file lrecl : 1000, total records 100000. unique key: 1 to 20
2nd file: LRECL : 40, Total records 100, unique key 1 to 20
i want to merge file 2 to file1 in such a way that for matching records in file 1 and file 2 :
1) 21 : 40 data from file 2 should be copied to 61 :80 in file 1
2) all unmatched records in file 1 should remain unchanged.

output file should contain all records of file 1

Is this a narrative: “Short Story from a Software Developer’s Life”?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2678
Location: NYC,USA

PostPosted: Sun Jun 06, 2021 10:15 am
Reply with quote

SUJEET06462 wrote:
i have 2 files, 1st file lrecl : 1000, total records 100000. unique key: 1 to 20
2nd file: LRECL : 40, Total records 100, unique key 1 to 20
i want to merge file 2 to file1 in such a way that for matching records in file 1 and file 2 :
1) 21 : 40 data from file 2 should be copied to 61 :80 in file 1
2) all unmatched records in file 1 should remain unchanged.

output file should contain all records of file 1

Welcome!
Read JOINKEYS under DFSORT manual.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2678
Location: NYC,USA

PostPosted: Mon Jun 07, 2021 7:34 pm
Reply with quote

Duplicate. Locked.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts COBOL Table data to a flat file with ... COBOL Programming 8
No new posts Compare 2 files replace data in 1st f... DFSORT/ICETOOL 4
No new posts Merging 2 files but ignore duplicate... DFSORT/ICETOOL 1
No new posts DB2 SQL query to read and update data... DB2 12
No new posts How to append Previous date into a S... JCL & VSAM 2
Search our Forums:

Back to Top