NUMPROC
NUMPROC affects the treatment and processing of signs in internal decimal and zoned decimal data.
- Default
- NUMPROC=NOPFD
- NOPFD
- Repairs signs on input. After repair is performed, the signs meet the criteria for NUMPROC=PFD.
- PFD
- Optimizes the generated code, especially when a non-zero
OPTIMIZE
level (OPT=1
orOPT=2
) is specified. No explicit sign repair is performed. Note that NUMPROC=PFD has stringent criteria to produce correct results. To use NUMPROC=PFD:- The sign position of unsigned numeric items must be X'F'.
- The sign position of signed numeric items must be either X'C' if positive or zero, or must be X'D' if negative.
- The sign position of separately signed numeric items must be either '+' if positive or zero, or '-' if otherwise.
Elementary MOVE and arithmetic statements in Enterprise COBOL always generate results with these preferred signs; however, group MOVEs and redefinitions might produce nonconforming results. The numeric class test can be used for verification. With NUMPROC=PFD, a numeric item fails the numeric class test if the signs do not meet the preferred sign criteria.
Performance consideration: Using NUMPROC=PFD generates significantly more efficient code for numeric comparisons. For most references to COMP-3 and DISPLAY numeric data items, using NUMPROC=NOPFD generates extra code because of sign
fix-up
processing. This extra code might also inhibit some other types of optimizations. Before setting this option, consult with your application programmers to determine the effect on the application program's output.
Both the NUMPROC and NUMCLS options affect the numeric class test. With NUMPROC=NOPFD, the results of the numeric class test are controlled by how NUMCLS is set. When NUMPROC=PFD, a data item must meet the preferred sign criteria to be considered numeric.