View previous topic :: View next topic |
Author |
Message |
sivafdms Intermediate
Joined: 29 May 2007 Posts: 165 Topics: 77
|
Posted: Tue Jul 19, 2016 9:10 am Post subject: Merge multiple records to single record |
|
|
Hi Team,
Can you please help to create sort card which merge multiple records to single record.
Code: |
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
****** ***************************** Top of Data ******************************
000001 071916 B14
000002 NOT LOADED
000003 ABCDEF12 07/17/16
000004 ABCDEF13 07/18/16
****** **************************** Bottom of Data ****************************
|
Output file
Code: |
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
****** ***************************** Top of Data ******************************
000001 071916 B14 NOT LOADED ABCDEF12 07/17/16
000002 ABCDEF13 07/18/16
****** **************************** Bottom of Data ****************************
|
Thanks,
Siva |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
|
Posted: Tue Jul 19, 2016 10:45 am Post subject: |
|
|
sivafdms,
1. What is the rule to merge the records? Every 3 records?
2. What is the LRECL and RECFM of the input file?
3. Did you search before posting, as there is another similar topic right underneath your topic. Your requirement is just that the data is already arranged in place to be merged.
http://www.mvsforums.com/helpboards/viewtopic.php?p=61685#61685 _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
sivafdms Intermediate
Joined: 29 May 2007 Posts: 165 Topics: 77
|
Posted: Wed Jul 20, 2016 8:51 am Post subject: |
|
|
Hi Kolusu,
1. The input may have not fixed records, only one thing is constant is first record and other will vary.
2. LRECL for all records are 80bytes
3. I searched ,but did not get this post.
Thanks,
Siva |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
|
Posted: Wed Jul 20, 2016 10:46 am Post subject: |
|
|
sivafdms wrote: | Hi Kolusu,
1. The input may have not fixed records, only one thing is constant is first record and other will vary. |
what is the desired output for the variable data like this
or if it this type
Code: |
071916 B14
B15
B16
NOT LOADED
LOADED
NOT MOVED
MOVED
ABCDEF12 07/17/16
ABCDEF13 07/18/16
|
_________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
sivafdms Intermediate
Joined: 29 May 2007 Posts: 165 Topics: 77
|
Posted: Thu Jul 21, 2016 9:33 am Post subject: |
|
|
Hi Kolusu,
We will get the input file in below manner, every time the first record will be constant. But from second record they will vary from day to day.
Code: |
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
****** ***************************** Top of Data ******************************
000001 071916 B14
000002 NOT LOADED
000003 ENDED_OK ABCDEF12 07/17/16
000004 ABCDEF13 07/18/16
000004 ABCDEF14 07/19/16
****** **************************** Bottom of Data ****************************
|
Output file
Code: |
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
****** ***************************** Top of Data ******************************
000001 071916 B14 NOT LOADED ABCDEF12 07/17/16
000002 ENDED_OK ABCDEF13 07/18/16
000003 ABCDEF14 07/19/16
****** **************************** Bottom of Data ****************************
|
Thanks,
Sivakumar |
|
Back to top |
|
|
NorthernDancer Beginner
Joined: 01 May 2007 Posts: 44 Topics: 22 Location: DOWNTOWN BUFFALO, NY
|
Posted: Fri Jul 22, 2016 9:00 am Post subject: |
|
|
It appears that your input data consists of an "owner" (1st record with the key), and followed by 1-M "members" in sort of a "set". So I would create a new "scanner" or "parser" if you will, to apply the key to the "members". You can attach a work suffix to the end of each record and build a sort key in it. Then a 2nd "scanner" could read that and merge the records together. Something like that. May need a couple of SORTs as well. Alternately, amend the module that creates that data and make it write out a working sort key. |
|
Back to top |
|
|
|
|