View previous topic :: View next topic |
Author |
Message |
sublak123 Beginner
Joined: 29 Jun 2017 Posts: 6 Topics: 6
|
Posted: Wed Oct 11, 2017 7:17 am Post subject: Combining two records into single record. |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12358 Topics: 75 Location: San Jose
|
Posted: Wed Oct 11, 2017 10:05 am Post subject: |
|
|
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 |
|
|
|
|