IBM Extension
IBM Extension

Pointer Data Items

Pointer data items are items defined explicitly as USAGE IS POINTER. Otherwise, they are ADDRESS OF data items or ADDRESS OF special registers, which are implicitly defined as USAGE IS POINTER.

Only EQUAL and NOT EQUAL are allowed as relational operators when you specify pointer data items. 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 not a meaningful ordering that can be applied to pointer data items.

Read syntax diagramSkip visual syntax diagram
ADDRESS Comparison - Format

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

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

identifier-1, identifier-3
May specify any level item defined in the Data Division Section, except level 66 and level 88.
identifier-2, identifier-4
Must be described as USAGE IS POINTER.
NULL(S)
Can be used only if the other operand is one of these:
  • An item whose usage is POINTER
  • The ADDRESS OF an item
  • The ADDRESS OF special register.

That is, NULL=NULL is not allowed.

End of IBM Extension
End of IBM Extension