Re: issue with comp-3 variable movement?
Posted: Fri Jul 26, 2013 8:59 pm
Hello,
Not quite true . . . A comp-3 (packed-decimal) might contain x'00' in one or more high-order bytes. A comp-3 value will NEVER contain x'00' in the low-order byte
Because neither has a valid sign. They do not follow the rules for comp-3.
The high-order bytes are the bytes before the 044F.
You need to better understand the INSPECT and the implications of the various PICTUREs of the fields. I don't believe i seen an INSPECT of comp or comp-3 data. . .
x'00' ZERO - usage is comp/comp-3
Not quite true . . . A comp-3 (packed-decimal) might contain x'00' in one or more high-order bytes. A comp-3 value will NEVER contain x'00' in the low-order byte
But could you please advice why x'40' and x'F0' also not good for COMP-3?
Because neither has a valid sign. They do not follow the rules for comp-3.
+44, PIC 9(9) COMP-3 would contain x'000000044F'. high-order bytes mean?
The high-order bytes are the bytes before the 044F.
When we do have comp/comp-3 variables in our copybooks, I should avoid this kind of INSPECT statements. Because it replaces the zeros. Am I correct? Please advice
You need to better understand the INSPECT and the implications of the various PICTUREs of the fields. I don't believe i seen an INSPECT of comp or comp-3 data. . .