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 multiple records to single record

 
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: Tue Jul 19, 2016 9:10 am    Post subject: Merge multiple records to single record Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Jul 19, 2016 10:45 am    Post subject: Reply with quote

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
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: Wed Jul 20, 2016 8:51 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Jul 20, 2016 10:46 am    Post subject: Reply with quote

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

Code:

 071916    B14                                                                 
           B15                                                                 
           B16                                                                 


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
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: Thu Jul 21, 2016 9:33 am    Post subject: Reply with quote

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
View user's profile Send private message
NorthernDancer
Beginner


Joined: 01 May 2007
Posts: 44
Topics: 22
Location: DOWNTOWN BUFFALO, NY

PostPosted: Fri Jul 22, 2016 9:00 am    Post subject: Reply with quote

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
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