Skip to Content
0
Former Member
May 04, 2011 at 06:31 PM

Packed decimal conversion from flat file

430 Views

Hi

I have a flat file which contains packed decimal, when I opened this file in Notepad++ packed decimal field was represented as SOH NUL FF. These are basically control characters and might have different lengths thus affecting the output of my conversion job that reads flat file and creates an XML out of it.

1. I'm not sure why these packed decimal fields appear as ascii control characters.

2. While converting to XML job should stop if new line starts and should start a new parent node in xml, but it's doing something like this

<data>
       <parent>
              <field1>field1-value</field1>
              <field2>field2-value</field2>
              <field3>field1-value</field3> 
       </parent>
       <parent>
              <field1>field2-value</field1>
              <field2>field1-value</field2>
              <field3>field2-value</field3>
       </parent>
</data>

<field3>field1-value</field3> This tag should not contain any value and field1-value is part of next row and should go to second parent tag with <field1> but in absence of field3 value this is what's happening, however I can see CR and LF at the end of the row

Thanks

Ravikant Singh