Dictionary Maintenance
Data Definition Language (DDL) Reference Manual — 426798-002
10 -10
Modifying Referenced Objects
Before you can modify a referenced object, you must first delete any objects that refer
to that object. After you modify the object, you must redefine the deleted objects. The
deletion and the redefinition must be done in exact sequence. For example:
CONSTANT a VALUE IS 1.
DEF b TYPE BINARY VALUE IS a.
DEF c TYPE b.
To modify the constant A, you must first delete definition C and then delete definition B
in that order. After modifying constant A, you must first redefine definition B and then
redefine definition C in the reverse order. This sequence ensures that you do not try to
delete a referenced object or add an object that refers to a nonexistent object.
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 OUTPUT
UPDATE statement helps you by performing these functions:
•
It locates all the objects that refer to a specified object.
•
It writes 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.
•
It writes 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 an 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 DDL 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 DDL. If you remain interactive, you enter the editor with the