P. 1
COBOL - Programming Guide

COBOL - Programming Guide

|Views: 968|Likes:
Publicado pormukesh

More info:

Published by: mukesh on Jul 01, 2011
Direitos Autorais:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
See more
See less


The COBOL NUMPROC compiler option affects sign processing for external
decimal and internal decimal data.NUMPROC has no effect on binary data or
floating-point data.For additional details on the NUMPROC compiler option, see its
description under “NUMPROC” on page241.


Given X'sd', where s is the sign representation and d represents the digit, when
you use NUMPROC(PFD), the compiler assumes that the sign in your data is one
of three preferred signs:

Signed positive or 0:


Signed negative:


Chapter 6.Numbers and Arithmetic


Coding Your Program

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 be sure you use preferred signs with your data
for correct processing.


When the NUMPROC(NOPFD) compiler option is in effect, the compiler accepts
any valid sign configuration.When processing is done with DISPLAY or
PACKED-DECIMAL data, the sign in the sending item is converted to the preferred
sign before the operation is performed.The preferred sign is also generated in the
receiver.NUMPROC(NOPFD) is less efficient than NUMPROC(PFD), but it should
be used whenever data that does not use preferred signs might exist.

If an unsigned, external decimal sender is moved to an alphanumeric receiver, the
sign is unchanged (even with NUMPROC(NOPFD)).


When NUMPROC(MIG) is in effect, the compiler generates code that is similar to
that produced by DOS/VS COBOL.This option can be especially useful as a tool
when migrating DOS/VS COBOL programs to COBOL/VSE.

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->