EBCDIC to ASCII packed decimals with a NULL value
Posted: Thu Feb 23, 2006 8:34 pm
We're converting numerous EBCDIC tables to ASCII with great success. Almost all packed and zoned decimals are converting perfectly.
The only issue is when an EBCDIC packed decimal being filtered, instead of being zero '0', is in fact NULL. When NULL is found, TextPipe Pro translates this into an ASCII value of the numbers '4' and '0' repeated.
For example, if the filter is instructed to expand a packed decimal of 4 bytes with 0 implied decimal places, and the EBCDIC data is NULL, TextPipe Pro returns '+4040404'. If the packed decimal is 8 bytes with 2 implied decimal places, then the filter returns '+4040404040404.04'.
Sadly, we can't always assume that a string of 4's and 0's is always wrong - there's a million-to-one chance it could be a genuine number. We really need TextPipe Pro to deal with the NULL's properly - maybe by returning NULL or zero.
Any advice or help would be greatly appreciated.
Many thanks.
The only issue is when an EBCDIC packed decimal being filtered, instead of being zero '0', is in fact NULL. When NULL is found, TextPipe Pro translates this into an ASCII value of the numbers '4' and '0' repeated.
For example, if the filter is instructed to expand a packed decimal of 4 bytes with 0 implied decimal places, and the EBCDIC data is NULL, TextPipe Pro returns '+4040404'. If the packed decimal is 8 bytes with 2 implied decimal places, then the filter returns '+4040404040404.04'.
Sadly, we can't always assume that a string of 4's and 0's is always wrong - there's a million-to-one chance it could be a genuine number. We really need TextPipe Pro to deal with the NULL's properly - maybe by returning NULL or zero.
Any advice or help would be greatly appreciated.
Many thanks.