IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Merge multiple records into single record based on Key


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7311
Location: Inside the Matrix

PostPosted: Wed May 27, 2015 7:41 pm
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7311
Location: Inside the Matrix

PostPosted: Thu May 28, 2015 11:31 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. how to extract a portion (e.g. fields... SYNCSORT 8
No new posts Selecting multiple constant records DB2 3
This topic is locked: you cannot edit posts or make replies. Writng matched records into output fi... DFSORT/ICETOOL 11
No new posts Compare the file record count percent... DFSORT/ICETOOL 4
No new posts Merging more than two records DFSORT/ICETOOL 15
Search our Forums:

Back to Top