View previous topic :: View next topic
|
Author |
Message |
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
By "similar", you mean "the same"?
Is the maximum number of multiple keys five? |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
OK. And the second question? |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Hi Bill,
Yes, the maximum number of multiple keys will be FIVE. |
|
Back to top |
|
|
|