Rational Developer for System z
Enterprise COBOL for z/OS, Version 4.1, Language Reference


Data pointer relation conditions

Only EQUAL and NOT EQUAL are allowed as relational operators when specifying pointer data items. Pointer data items are items defined explicitly as USAGE POINTER, or are ADDRESS OF special registers, which are implicitly defined as USAGE POINTER.

The operands are equal if the two addresses used in the comparison would both result in the same storage location.

This relation condition is allowed in IF, PERFORM, EVALUATE, and SEARCH format-1 statements. It is not allowed in SEARCH format-2 (SEARCH ALL) statements because there is no meaningful ordering that can be applied to pointer data items.

Read syntax diagramSkip visual syntax diagram
Format 2: data-pointer relation condition

>>-+-ADDRESS OF--identifier-1-+--+----+--+-----+---------------->
   +-identifier-2-------------+  '-IS-'  '-NOT-'   
   +-NULL---------------------+                    
   '-NULLS--------------------'                    

>--+-EQUAL--+----+-+--+-ADDRESS OF--identifier-3-+-------------><
   |        '-TO-' |  +-identifier-4-------------+   
   '-=-------------'  +-NULL---------------------+   
                      '-NULLS--------------------'   

identifier-1, identifier-3
Can specify any level item defined in the linkage section, except 66 and 88.
identifier-2, identifier-4
Must be described as USAGE POINTER.
NULL, NULLS
Can be used only if the other operand is defined as USAGE POINTER. That is, NULL=NULL is not allowed.

The following table summarizes the permissible comparisons for USAGE POINTER, NULL, and ADDRESS OF.

Table 1. Permissible comparisons for USAGE POINTER, NULL, and ADDRESS OF
 

USAGE POINTER
second operand

ADDRESS OF
second operand

NULL or NULLS
second operand

USAGE POINTER
first operand

Yes Yes Yes

ADDRESS OF
first operand

Yes Yes Yes

NULL/NULLS
first operand

Yes Yes No
Yes
Comparison allowed only for EQUAL, NOT EQUAL
No
No comparison allowed

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)