on 10-21-2013 9:26 PM
Hi ,
I am trying to read a file to create Header(o:1), line Item (0:n) and (trailer 0:1)
Header: Occurrence is 1, key element is 03, length is 160 (suppose filed name are abcd)
Lineitem : Occurrence is n, key element is 06, length is 160 (suppose filed name are efghi)
Trailer is :Occurrence is 1, key element is 08, length is 160 (suppose filed name are xyz)
Worst part is there is no end separator therefore entire records comes in a single row. And as the number of line item is 0 to unbounded)
Therefore facing issue.
Any suggestion to handle it at Adapter or integration level?
Regards,
Sudeep
Hi Sudeep
This is one of the common requirement. Write a simple java mapping and convert the data to desired format.
Use substring function to separate the header ,item and trailer data.
Header = Substring (0,160)
item = Substring ( 161 ,length-160)
trailor= Substring (length-160+1 , length)
Then apply the logic to seprate the item data, since the item data will contain multiple line item details.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use java program to create the separation in the file for both header and trailer. Once you converted into header, item and trailer format then you can use PI to poll the file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sudeep,
If you have fixed length for Header, lineitem and trailer, then
you can read the file as simple2XML and convert into simple XML (one segment unbounded
segment containing all the data).
then you can distinguish the data in mapping.
Regards,
Harish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.