Sign representation of zoned and packed-decimal data
Sign representation affects the processing and interaction of zoned decimal and internal decimal data.
Given X'
sd'
,
where s is the sign representation and d represents
the digit, the valid sign representations for zoned decimal
(USAGE DISPLAY
) data without the SIGN IS
SEPARATE
clause are:
- Positive:
C
,A
,E
, andF
- Negative:
D
andB
The
COBOL NUMPROC
compiler option affects sign processing
for zoned decimal and internal decimal data. NUMPROC
has
no effect on binary data, national decimal data, or
floating-point data.
- NUMPROC(PFD)
- Given
X'
sd'
, where s is the sign representation and d represents the digit, when you useNUMPROC(PFD)
, the compiler assumes that the sign in your data is one of three preferred signs:- Signed positive or 0:
X'C'
- Signed negative:
X'D'
- Unsigned or alphanumeric:
X'F'
Based on this assumption, the compiler uses whatever sign it is given to process data. The preferred sign is generated only where necessary (for example, when unsigned data is moved to signed data). Using the
NUMPROC(PFD)
option can save processing time, but you must use preferred signs with your data for correct processing. - NUMPROC(NOPFD)
- When the
NUMPROC(NOPFD)
compiler option is in effect, the compiler accepts any valid sign configuration. The preferred sign is always generated in the receiver.NUMPROC(NOPFD)
is less efficient thanNUMPROC(PFD)
, but you should use it whenever data that does not use preferred signs might exist.If an unsigned, zoned-decimal sender is moved to an alphanumeric receiver, the sign is unchanged (even with
NUMPROC(NOPFD)
in effect).