You can use the DEFINED attribute to overlay variable storage,
but DEFINED overlay the storage permanently.
When based variables are overlaid with a locator reference, the association can be changed at any time in the program by assigning a new value to the locator variable.
Joined: 08 May 2006 Posts: 171 Location: Dublin, Ireland
Here's a couple of samples.
The first code snippet shows use of DEFINED where the record-area is a variable within the program. RECORD_AREA1 and the DEFINED variable are in a fixed location.
whereas the second snippet shows overlaying (redefining) on a relocatable . The READ SET statement relocates the structure to the record in the I/O buffer. The BASED(ADDR(FIELD1)) is also relocated. This cannot be done with DEFINED.