As we're going to install IBM Enterprise COBOL 5.1 soon I'm looking to decide 
what default compile options we should use, and if we should perhaps change 
some.  Plus we have to decide what the defaults for the new compile options 
should be.  We'll just discuss NUMPROC here so-as to not make the post TOO long.


NUMPROC: To PFD or to not PFD
Currently we use NUMPROC=MIG, which is no longer even an available option.

Looks like PFD generates more efficient code because it does not do 'numeric 
fixup'.

Do we only need to be concerned with the numeric class test, but not with moves 
and arithmetic?  My testing shows the following:

with NUMPROC=PFD
- unsigned data in signed field: fails NUMERIC test
- signed data in unsigned field: fails NUMERIC test

with NUMPROC=NOPFD and NUMCLS=PRIM
- unsigned data in signed field: fails NUMERIC test
- signed data in unsigned field: passes NUMERIC test


So in either case numeric fails if there is unsigned data (last nibble = f) in 
a field position we've defined as being signed.  Since this is already "wrong", 
if we're doing it (and I don't know that we are!), no harm going to PFD in this 
case.

But it appears that we could, with NOPFD, pass a numeric test if the data is 
signed (either positive or negative) but the field is defined as unsigned.  And 
this would no longer pass with PFD.  So the question is, do we do this?  Well, 
I don't know.  And I can't imagine looking through maybe tens of thousands of 
numeric tests (or may not that many...) to make sure the data matches the 
definition.

Should we risk it?  Has anyone out there ever "migrated" to PFD with "legacy" 
data files?  I'm quite certain that we do have at least some cases where one 
program wrote out data defined as signed and other programs read it with the 
same area defined as unsigned.  Curse it, but I know I've seen it.  I think the 
less likely, but not impossible, situation would be testing it for numeric.  
Mostly we only test for numeric if:
- We sometimes intentionally store non-numeric (usually low-values; maybe 
spaces sometimes) data in a numeric field in some situations
- We're getting data from an external source and want to validate it (though I 
imagine we do this far less than we perhaps should!).

Thanks,
Frank

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to