IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

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: 7312
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: 7312
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 All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts Inserting records into the empty segm... IMS DB/DC 0
This topic is locked: you cannot edit posts or make replies. Splice JCL into one record for DD sta... SYNCSORT 2
No new posts Need to split single line into two li... DFSORT/ICETOOL 7
No new posts Copying data from prev record using SORT SYNCSORT 19
No new posts Break a record into fields, each fiel... SYNCSORT 2

Back to Top