ILE COBOL Programmer's Guide

Using ADDRESS OF and the ADDRESS OF Special Register

When you specify ADDRESS OF in an ILE COBOL program, the compiler determines whether to use the calculated address of a data item, referred to as ADDRESS OF, or the ADDRESS OF special register. The ADDRESS OF special register is the starting address of the data structure from which all calculated addresses are determined. Because the ADDRESS OF special register is the starting address of a structure, it must be an 01-level or 77-level data item. If you reference modify this data item, it is no longer the starting address of the data structure. It is a calculated address, or ADDRESS OF. If you are taking the ADDRESS OF an elementary item, and the ADDRESS OF the 01-level item has been set to NULL, a pointer exception (MCH3601) results.

You cannot use the calculated ADDRESS OF where an item can be changed. Only the ADDRESS OF special register can be changed. For example, in Figure 83, the SET statement at (17) uses the ADDRESS OF special register because it is an 01-level item. At (18), ADDRESS OF is used because, although it is an 01-level item, it is reference-modified.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]