Data Definition Language (DDL) Reference Manual

Dictionary Maintenance
Data Definition Language (DDL) Reference Manual529431-004
10-11
Modifying Referenced Objects
When an object is referenced by many other objects, deleting and then redefining all
the referring objects is a time-consuming and error-prone process. The statement
OUTPUT UPDATE on page 8-7 helps you by performing these functions:
Locating all the objects that refer to a specified object.
Writing the DELETE statements to delete the referring objects to an open DDL
source file. OUTPUT UPDATE deletes the objects in sequence so that an object is
never deleted before an object that refers to it.
Writing the statements to define the object to be modified, followed by the
statements to redefine each deleted object to the open DDL source file. OUTPUT
UPDATE redefines objects in sequence so that referenced objects are defined
before any objects that refer to them.
After executing OUTPUT UPDATE, you can edit the statement that defines the object
you are changing. When the statement is changed to your satisfaction, compile the
DDL source file into the open dictionary. The source file contains the code to delete all
referring objects and then rebuild them. If you decide to make no changes, the source
file contains the code to return your dictionary to its initial state.
You can edit and compile the source file in an interactive session, or you can perform
these functions noninteractively. Generally, you run the DDL compiler interactively to
make minor modifications.
Assume you are in an interactive DDL session. To modify a referenced object, do this:
1. Open the dictionary containing the object you want to modify.
2. Open a DDL source file to contain the statements generated by OUTPUT
UPDATE. If the file already exists, make sure it is empty before OUTPUT UPDATE
writes to it.
3. Use OUTPUT UPDATE to write the statements that delete the referring objects,
that define the object to be modified, and that redefine the deleted objects to the
open DDL source file.
4. Use the NODDL command to close the DDL source file
5. Edit the object definition in the DDL source file. You can do the editing interactively
or you can exit from the DDL compiler. If you remain interactive, you enter the
editor with the DDL EDIT command; if you exit from the DDL compiler, you run the
editor from the command interpreter.
Example 10-8. Objects That Reference Other Objects
CONSTANT a VALUE IS 1.
DEF b TYPE BINARY VALUE IS a.
DEF c TYPE b.