Allowed Changes to Subsets details the changes that can be made to a subset during an update, reorganization, or modeling process. Numbers in parentheses refer to explanatory notes following the table.
Table 40. Allowed Changes to Subsets
Option |
Model |
Update |
File Format Conversion (No Key Changes) |
Record Format Conversion (Key Changes) |
---|---|---|---|---|
Add new disjoint automatic or manual subset for existing data set. |
No |
Yes (1) |
Yes (1) |
|
Add new disjoint automatic or manual subset for new data set. |
No |
Yes |
Yes |
|
Add new embedded subset. |
No |
Yes (2) |
Yes (2) |
|
Delete existing disjoint automatic or manual subset. |
No |
Yes (3,9) |
Yes (3,9) |
|
Delete existing embedded automatic or manual subset. |
No |
Yes (3,4,9) |
Yes (3,4,9) |
|
Change automatic subset to manual subset or vice versa. |
No |
No |
No |
No |
Change subset to set or set to subset. |
No |
No |
Yes (7,8) |
|
Change subset type. |
No |
No |
No |
No |
Change data set referenced by subset. |
No |
No |
No |
|
Change subset keys. |
No |
No |
No |
|
Change ASCENDING/DESCENDING option. |
No |
No |
No |
|
Change DUPLICATES option. |
No |
Yes (6) |
Yes (6) |
|
Add, change, or delete key data. |
No |
No |
No |
|
Change where condition. |
No |
No |
No |
Yes (5) |
Change RECORDCOUNT option. |
No |
No |
Yes |
Yes |
Add or delete SECTIONS option. |
No |
No |
Yes |
Yes |
Add, delete, or change a section bounds specification |
No |
No |
Yes |
Yes |
Explanatory Notes
-
Adding a new subset can change the REQUIRED option for some items because all key items are implicitly required. If the item does not affect the location of the first REQUIRED option, you can change the REQUIRED option by using the update process.
Declaring a new subset does not automatically insert applicable records for existing data sets. The reorganization process can be used to generate the automatic subset from the data set. The user must ensure that all existing data set records have valid key values. Key items must not be null, and if the subset does not permit duplicates, all key values must be unique. If the Reorganization program encounters a record with a null value or a duplicate key, it terminates with an exception.
The Reorganization program cannot determine the sequence in which records were originally added to the data set. Therefore, when a subset specifying DUPLICATES FIRST or DUPLICATES LAST is generated from the data set, existing records are not stored in chronological order. All records added following the reorganization are maintained in proper sequence.
Note: For information on the DUPLICATE options and SINGLEABORT recovery, see “DUPLICATES Option” under “Subsets” in Sets, Subsets, and Accesses. When adding a new set to an existing data set and modifying this data set within the same DASDL update for a model database, the GENERATE statement for the new set must be included in the BUILDREORG input.
-
New embedded subsets can be added provided their master data set is added at the same time.
-
Deleting a subset can change the REQUIRED option for some items because all key items are implicitly required. If the item does not affect the location of the first REQUIRED option, you can change the REQUIRED option by using the update process.
When a subset is deleted, any program which attempts to use it terminates with an INVALID OP error.
-
Embedded subsets can be deleted, regardless of whether the master data set is deleted at the same time.
When an embedded subset is deleted, it must also be eliminated from all remaps which include it.
-
A key, key data, the ASCENDING/DESCENDING option, the DUPLICATES option, or the where condition cannot be changed for an embedded or manual structure.
Modifying data items that are used in a where condition can force a reorganization of the subset. Also, adding, deleting, or changing data items that are physically located before items used in a where condition can change the offset of the items in the where condition and force a reorganization of the subset.
-
The NO DUPLICATES option can be changed to DUPLICATES FIRST or DUPLICATES LAST. A reorganization is required if NO DUPLICATES is changed to DUPLICATES. No other changes are permitted.
-
A change involving an embedded or manual structure is not allowed.
-
Changing from a subset to a set might cause the default value of the DUPLICATES option to be changed. A reorganization fails with a DUPLICATES exception if there are duplicate subset entries.
-
When the structure with the highest number has been deleted from the database schema (DASDL), the application programs that have not been recompiled might receive an OPEN ERROR 17. The error results from invoking the deleted structure and occurs regardless of whether the application actually uses the structure. OPEN ERROR 17 messages continue to occur as long as the number of the highest structures invoked by the program is greater than the number declared in DASDL.
An error can also occur when the application does not specify the deleted structure for some operation. If a subsequent DASDL update process adds a new structure and reuses the number from the previously deleted structure, the application receives a VERSION ERROR 2.
You can avoid these errors by recompiling the program.