CICS VSAM Transparency for z/OS, Version 1.2


PACKC2F

DB2® stores packed decimal data in signed format. In COBOL, a packed decimal field can be defined as signed or unsigned as follows:
Signed:
PIC S999V99 COMP-3
Unsigned:
PIC 99999V99 COMP-3

Assume you have a field defined as PIC 999V99 COMP-3 (unsigned). In your VSAM file, a value of 123.45 is physically stored as X'12345F'. DB2 treats all decimal column values as signed. If you map this unsigned field to a decimal column, CICS® VT would return a field value of X'12345C' to your application.

Unless the field is part of the key or an alternate index path, it may not affect your application program but it would be highlighted by the CICS VT dual mode facility (DMF) as a difference, and therefore an error. To avoid this error use the generic exit PACKC2F. It resets the sign bits from b'1100' to b'1111' when the field is retrieved from DB2.

If the field is part of the base cluster key or an alternate index key, values retrieved from DB2 must be converted to unsigned values using an exit such as PACKC2F.



Concept topic


Last updated: February 8, 2013 20:43:57