Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 9405

COBOL Programming :: RE: comparing comp-3 and unpacked numbers

$
0
0
Author: Robert Sample
Posted: Mon May 30, 2016 7:05 pm (GMT 5.5)

Have you read the Enterprise COBOL Language Reference manual on numeric comparisons? If not, why not -- it has almost all the answers you could possibly want on how COBOL works on the mainframe. If you did read that, did you not see this on page 272 of the version 6.1 COBOL manual (emphasis added by me):
Quote:
Numeric comparisons
A numeric comparison is a comparison of the algebraic value of two operands of
class numeric.
When the algebraic values of numeric operands are compared:
v The length (number of digits) of the operands is not significant.
v The usage of the operands is not significant.

v Unsigned numeric operands are considered positive.
v All zero values compare equal; the presence or absence of a sign does not affect
the result.
The behavior of numeric comparisons depends on the settings of the NUMPROC
and ZONEDATA compiler options. For details,

_________________
TANSTAAFL

The first rule of code reuse is that the code needs to be worth re-using.

"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." -- Donald Knuth


Viewing all articles
Browse latest Browse all 9405

Trending Articles