MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Merge the two files.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Thu Feb 16, 2017 9:46 am    Post subject: Merge the two files. Reply with quote

Hi,

I want to merge below two files as show below. Can you please help with the sort card.

Input file1

Code:

****** ***************************** Top of Data ******************************
000001 2017-02-14 AAAA                                                         
000002 2017-02-15 BBBB                                                         
****** **************************** Bottom of Data ****************************


Input file2

Code:

****** ***************************** Top of Data ******************************
000001 2017-02-14        CCCC                                                 
000002 2017-02-15        DDDD                                                 
000003 2017-02-16        EEEE                                                 
000004 2017-02-17        FFFF                                                 
****** **************************** Bottom of Data ****************************



Output file

Code:

****** ***************************** Top of Data ******************************
000001 2017-02-14 AAAA   CCCC                                                 
000002 2017-02-15 BBBB   DDDD                                                 
000003 2017-02-16        EEEE                                                 
000004 2017-02-17        FFFF                                                 
****** **************************** Bottom of Data ****************************


Thanks,
Siva
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12357
Topics: 75
Location: San Jose

PostPosted: Thu Feb 16, 2017 12:03 pm    Post subject: Reply with quote

sivafdms,

Use Joinkeys function to match on the date field.

1. As the data seems to be already sorted, use the date field as a key and code sorted, noseqck
2. Use JOIN UNPAIRED to get both matches and unmatched records.
3. Use REFORMAT statement to pick the values from the different files.
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Fri Feb 17, 2017 5:18 am    Post subject: Reply with quote

Thanks Kolusu!! It worked, it was so simple. I was thinking we need complex operations to do this. Also learned new option noseqchk.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group