Format 5: SET for USAGE IS POINTER data items

When this form of the SET statement is executed, the current value of the receiving field is replaced by the address value contained in the sending field.

Format 5: SET statement for USAGE IS POINTER data items

Read syntax diagramSkip visual syntax diagramSETidentifier-4ADDRESS OFidentifier-5TO identifier-6ADDRESS OFidentifier-7NULLNULLS
identifier-4
Receiving fields.

Must be defined as USAGE IS POINTER .

ADDRESS OF identifier-5
Receiving fields.

identifier-5 must be level-01 or level-77 items defined in the LINKAGE SECTION. The addresses of these items are set to the value of the operand specified in the TO phrase.

identifier-5 must not be reference-modified.

identifier-6
Sending field.

Must be defined as USAGE IS POINTER .

Cannot contain an address within the program's own WORKING-STORAGE SECTION, FILE SECTION, or LOCAL-STORAGE SECTION.

ADDRESS OF identifier-7
Sending field.

identifier-7 must name an item of any level except 66 or 88 in the LINKAGE SECTION, the WORKING-STORAGE SECTION, or the LOCAL-STORAGE SECTION. ADDRESS OF identifier-7 contains the address of the identifier, and not the content of the identifier.

NULL, NULLS
Sending field.

Sets the receiving field to contain the value of an invalid address.

The following table shows valid combinations of sending and receiving fields in a format-5 SET statement.

Table 1. Sending and receiving fields for format-5 SET statement
Sending field USAGE IS POINTER receiving field

ADDRESS OF
receiving field


NULL/NULLS
receiving field

USAGE IS POINTER Valid Valid Invalid
ADDRESS OF Valid Valid Invalid
NULL/NULLS Valid Valid Invalid