Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Merge multiple records into single record based on Key

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Wed May 27, 2015 5:43 pm    Post subject: Merge multiple records into single record based on Key
Reply with quote

Hi All,

I have a specific requirement of merging multiple records into one based on the Key. Detailed specifications are follows.

Input File Specifications

1) Each period appears in the input file is not the period. but a HEX '05'.
2) File is sorted in the order of Code1, Flag, code2, Description1, Code3, Description2
3) Lengths of Variables
Code1 : 2
Flag : 1
Code2 : 3
Description1 : Till next Hex '05'
Count : 1
Code3 : 2
Description2 : Till next continuous spaces ' '


Input File is of Variable Block file of length 124
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
CODE1.FLAG.CODE2.DESCRIPTION1.COUNT.CODE3.DESCRIPTION2.                 
C1.I.ABC.DESCRIPTION1.9.AV.DESCRIPTION2                                 
C1.I.ABC.DESCRIPTION1.9.HM.SOME TEXT                                   
C1.A.BBG.SOME TEXT.3.ST.SOME MORE TEXT                                 
C1.A.BBG.SOME TEXT.3.UD.SOME EXTRA TEXT                                 
C1.A.BBG.SOME TEXT.3.ZB.TEXT                                           
C1.A.BBG.SOME TEXT.3.ZM.US DOLLARS                                     
C1.I.KBC.DESCRIBE.9.AS.TEXT TEXT                                       
C1.I.KBC.DESCRIBE.9.CA.SOME OTHER TEXT                                 
C1.I.KBC.DESCRIBE.9.SG.EXTRA TEXT                                       


Requirement :
If Code1, Flag, Code2, Description1, Count are similar, then
concatenate Code3 & Description2 into one record with PIPE delimited.

Output File Specifications:
File Length : 143
Code1 : 2
Flag : 1
Code2 : 3
Description1 : 15
Count : 1
Code3 : 2
Description2 : 20
This pair of values (in BOLD) repeat for 5 times in each row. Default values are SPACES.


Desired Output:
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3----+----4----+---
******************************************************************* Top of Data ********************************************************************
C1|I|ABC|DESCRIPTION1   |9|AV|DESCRIPTION2        |HM|SOME TEXT           |  |                    |  |                    |  |                    |
C1|A|BBG|SOME TEXT      |3|ST|SOME MORE TEXT      |UD|SOME EXTRA TEXT     |ZB|TEXT                |ZM|US DOLLARS          |  |                    |
C1|I|KBC|DESCRIBE       |9|AS|TEXT TEXT           |CA|SOME OTHER TEXT     |SG|EXTRA TEXT          |  |                    |  |                    |



Can you please suggest the sort card for this ?
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Wed May 27, 2015 7:41 pm    Post subject: Reply to: Merge multiple records into single record based on Key
Reply with quote

By "similar", you mean "the same"?

Is the maximum number of multiple keys five?
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Thu May 28, 2015 9:44 am    Post subject:
Reply with quote

Hi Bill Woodger,

Yes, I mean simple.

Requirement :
If Code1, Flag, Code2, Description1, Count are similar (i.e., same), then
concatenate Code3 & Description2 into one record with PIPE delimited.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Thu May 28, 2015 11:31 am    Post subject: Reply to: Merge multiple records into single record based on Key
Reply with quote

OK. And the second question?
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Thu May 28, 2015 3:57 pm    Post subject: Reply to: Merge multiple records into single record based on Key
Reply with quote

Hi Bill,

Yes, the maximum number of multiple keys will be FIVE.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us