Data Definition Language (DDL) Reference Manual
Dictionary Maintenance
Data Definition Language (DDL) Reference Manual—529431-004
10-10
Modifying Referenced Objects
Alternatively, assume that ORDERDATE is not defined in ORDERINFO. In this case,
write the definition of ORDERINFO together with all the definitions and records that
refer to it to the DDL source file, as in Example 10-7 on page 10-10.
Modifying Referenced Objects
Constants, definitions, and SPI token maps can be referenced by other objects. You
can use the SHOW USE OF command to determine whether the object you want to
modify is referenced by any other 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.
In Example 10-8
on page 10-11, 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.
7 File is "$data.sales.orders" Key-sequenced
8 Audit
9 Definition is ORDERINFO.
10
11 Key is ORDERNUM Duplicates not allowed.
12 Key "sn" is SALESPERSON.
13 Key "cn" is CUSTNUM.
14 End
*A 13
13 Key "cn" is CUSTNUM.
13.1 KEY "od" is ORDERDATE.
13.2 //
*EXIT
Add new alternate key
!?SOURCE newsrc
!EXIT
Compile modified record
Example 10-7. Modifying an Unreferenced Object
46> DDL DICT
!?DDL newsrc !
!OUTPUT UPDATE orderinfo.
!?NODDL, EDIT newsrc
ORDER-REC is included in NEWSRC
...
*EXIT
!?SOURCE newsrc
Add ORDERDATE to ORDERINFO and add key field
to ORDER-REC
Example 10-6. Modifying an Unreferenced Object (page 2 of 2)