Rational Developer for System z
COBOL for Windows, Version 7.5, Language Reference


Sign condition

The sign condition determines whether the algebraic value of a numeric operand is greater than, less than, or equal to zero.

Format
Read syntax diagramSkip visual syntax diagram>>-operand-1--+----+--+-----+--+-POSITIVE-+--------------------><
              '-IS-'  '-NOT-'  +-NEGATIVE-+  
                               '-ZERO-----'  
 
operand-1
Must be defined as a numeric identifier, or as an arithmetic expression that contains at least one reference to a variable. operand-1 can be defined as a floating-point identifier.

The operand is:

An unsigned operand is either POSITIVE or ZERO.

NOT
One algebraic test is executed for the truth value of the sign condition. For example, NOT ZERO is regarded as true when the operand tested is positive or negative in value.

Date fields in sign conditions

The operand in a sign condition can be a date field, but is treated as a nondate for the sign condition test. Thus if the operand is an identifier of a windowed date field, date windowing is not done, so the sign condition can be used to test a windowed date field for an all-zero value.

However, if the operand is an arithmetic expression, then any windowed date fields in the expression will be expanded during the computation of the arithmetic result prior to using the result for the sign condition test.

For example, given that:

then this sign condition would evaluate to true:

WIN-DATE IS ZERO

whereas this sign condition would evaluate to false:

WIN-DATE + 0 IS ZERO

Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)