Modeling with the Update or Reorganization Process

A family of modeled databases can be updated or reorganized. In these cases, the MODEL option is used in conjunction with the UPDATE option. The UPDATE option takes the following form:

UPDATE ;

The use of the two options together causes the control file for the new database to be updated rather than initialized. Continuity of the data files is maintained.

Because databases that use the same DMSUPPORT library code file must have the same update level, the DASDL update function must proceed so as to ensure that all databases are compatible at the new update level. The following update procedures guarantee that this condition is met.

One database is selected as the original database and is updated before all other databases that share the same DMSUPPORT library. DASDL is run to update the description file of the original databases, and new tailored software, including the DMSUPPORT library, is compiled. New description files cannot be created directly from old description files for the remaining databases because the update status of the new description files does not match the DMSUPPORT library. Instead, the new description files must be re-created from the updated description file of the original database. The new description files can then be used to compile the tailored software (excluding the DMSUPPORT library) and to update the control files of their respective databases.

Figure 15–1 illustrates the update process for two databases that share the same DMSUPPORT library. Description and control files are shown for databases LIVEDB and TESTDB at update levels n and n+1. The TESTDB database was created by modeling the LIVEDB database and did not exist prior to update level n.

Figure 15. Update Process for Two Databases That Share the Same DMSUPPORT Library

Update Process for Two Databases That Share the Same DMSUPPORT Library


The LIVEDB database was chosen as the original database and updated first. The updated description file of the LIVEDB database was then used to model an n+1 level description file for the TESTDB database. A SYSTEM/DMCONTROL update operation brought the control file of the TESTDB database forward. At level n+1, both databases use the DMSUPPORT library code file created from the n+1 level description file of the LIVEDB database. In practice, either database could have been selected as the original database in the update process.

Note: Although the TESTDB description file is updated from the LIVEDB description file, the current TESTDB description file must be present during the DASDL update compilation. During the DASDL update compilation, the description file of the modeled database is copied as DESCRIPTION/<modeled database name>/<update level>.

All databases need not be updated at the same time. For example, the updating of the TESTDB database from level n to n+1 could be performed at any time following the updating of the LIVEDB database. However, until updated to level n+1, the TESTDB database must continue to use the DMSUPPORT library compiled using the level n description file of the LIVEDB database.

Note: The following information affects a modeled database at level n that has not yet been updated to level n+1. All programs accessing the modeled database, including the Reorganization program, attempt to use the DMSUPPORT library that is titled DMSUPPORT/<database name>/<level n>. When this library is not available, an attempt is made to use the library titled DMSUPPORT/<database name>. If the update level of the DMSUPPORT library is different from the update level of the control file, the program fails with an UPDATE LEVEL MISMATCH error.

The following WFL job updates both the TESTDB and LIVEDB databases, adding the new data set Q:

?BEGIN JOB UPDATE/BOTHDBS;
%   UPDATE LIVEDB
COMPILE LIVEDB WITH DASDL;
COMPILER DATA
UPDATE;
OPTIONS (AUDIT);
D DATA SET (K NUMBER(6)) AREAS = 100;
S SET OF D KEY K;
Q DATA SET (Z ALPHA(12));
AUDIT TRAIL (KIND=TAPE, DUPLICATED ON TAPE);
?% -3--- END LIVEDB DASDL -----
%   UPDATE TESTDB
COMPILE TESTDB WITH DASDL;
COMPILER DATA
  MODEL LIVEDB;
  UPDATE;
  OPTIONS (AUDIT);
  CONTROL FILE (PACK = TESTPACK);
  D DATA SET (K NUMBER(6)) PACK = TESTPACK;
  S SET OF D KEY K PACK = TESTPACK;
  Q DATA SET (Z ALPHA(12)) PACK = TESTPACK;
  AUDIT TRAIL (PACK = TESTPACK);
?% ----- END TESTDB DASDL -----
 ?END JOB.