Cobol Zoned-Decimal Negative Numbers ...

I have a Cobol copybook that defines a field as PIC S9(8)V99.

For all “positive” numbers, I am receiving valid results.

For negative numbers ending in “0” (zero), I am getting valid results.

My issue is, for any value where the pennies column is 1 - 9 I get invalid results. My understanding of Zoned-Decimal is that the last byte will contain “A” through “I” for digits 1 - 9 positive and “J” through “R” for digits 1 - 9 negative. Positive zero = “{” and negative zero = “}”

I am receiving a value of ‘000000291Q’ which should resolve to -29.18, but instead it is resolving to -29.11. I have veriifed this back to the file, and I have used Designor Data Profiling to verify this.

Can someone please assist me in this?

I do not want to change the copybook to VARCHAR(10) and then write a transform to manage the type conversion to numeric based on a decode of the last byte, but I will if I have to. Argh!!!

Thanks …

Jeff in Chicago …


jwilgus :us: (BOB member since 2008-01-17)

Please do not cross-post. It leads to fragmented discussions and is against our forum rules.

locking this topic. Please use this one instead (in the DI Designer forum):


dnewton :us: (BOB member since 2004-01-30)