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 

Combining two records into single record.

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


Joined: 29 Jun 2017
Posts: 6
Topics: 6

PostPosted: Wed Oct 11, 2017 7:17 am    Post subject: Combining two records into single record. Reply with quote

Both Input & output file length is 133.
Input File :
Code:

TAMILNADU CHENNAI ANNANAGAR   10  20  30  40
TAMILNADU CHENNAI              6   7
TAMILNADU MADURAI KKNAGAR     05  10  15  20
TAMILNADU MADURAI              8   9
TAMILNADU MADURAI              3   4

Output File :
Code:

TAMILNADU CHENNAI ANNANAGAR   10  20  30  40  6  7
TAMILNADU MADURAI KKNAGAR     05  10  15  20  8  9



Description:
Quote:

1) In Input file for each city,there will be two or more than two records.
First record contains new value and second record contains old value.
For some of the cities, old value will have more than 1 record.
The output file should have only 1 record for each city containing both new and old values in same record.
2) For MADURAI, 'TAMILNADU MADURAI ' contains duplicate records.The duplicate records values should not be considered while populating into output file.

Can you please suggest me.
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Oct 11, 2017 10:05 am    Post subject: Reply with quote

sublak123,

It is about time that you follow couple of rules on these forums.

1. Learn to use the code tags. I have been editing your topics to make the data readable. Check this link which explains in detail about using code tags

https://www.mvsforums.com/helpboards/viewtopic.php?p=19031#19031

2. Provide feedback on the solutions you received whether the proposed solution worked or not. Do not simply try to get your work done here.

Coming to the topic, it is quite a simple task.

1. Use WHEN=GROUP and push the first records on to the next record at position 134 with RECORDS=2 for every KEYBEGIN.

2. Using OUTFIL and INCLUDE for contents greater than spaces at position 134 and use sections on the key and write out only the trailer3 records with necessary fields.

Give that a try and comeback if you run into problems. By doing so you will actual be able to make any changes if the requirements change later.
_________________
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
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