Page 1 of 1

EBCDIC to ASCII packed decimals with a NULL value

Posted: Thu Feb 23, 2006 8:34 pm
by IT.Help@WH-Ireland
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.

Posted: Tue Feb 28, 2006 2:28 pm
by DataMystic Support
If you could send us a sample file and copybook we'd be happy to look at it. We've just spent a lot of time searching for references to storage of null values, but have come up with nothing.

It's quite possible that codes above '9' in the lower nybble are used to indicate a NULL, in which case we can easily detect it.

Should the filter be outputting blanks, zeroes, 'NULL' or something else?, keeping in mind that we'd prefer to keep the field length constant.