Altering Data Items

Allowed Changes to Data Set Data Items details the changes that can be made to data set data items. Numbers in parentheses refer to explanatory notes following the table.

Table 29. Allowed Changes to Data Set Data Items

Option

Model

Update

File Format Conversion (No Item Changes)

Record Format Conversion (Item Changes)

Add new data item.

No

Yes (1,4,6)

Yes (1,4)

Yes (4,6)

Delete existing data item.

No

No

No

Yes (4,5)

Change DATAMASK option.

No

No

Yes

Yes

Change data item type.

No

No

No

Yes (4)

Change data item size.

No

No

No

Yes (4)

Change INITIALVALUE option.

No

Yes

Yes

Yes

Change NULL option.

No

No

No

Yes

Change OCCURS option.

No

No

No

Yes (4)

Change number of occurrences.

No

No

No

Yes (4)

Change REQUIRED option.

No

Yes (2)

Yes (3)

Yes (3)

Change STORED option.

No

No

No

No

Change precision.

No

No

No

Yes

Change scale factor.

No

No

No

Yes (4)

Change SIGNED option.

No

No

No

Yes (4)

Change object of OPTIONALLY WITH, DEPENDING ON, and so on.

No

No

No

Yes

Add or delete DEPENDING ON to or from existing OCCURS clause.

No

No

No

No

Add or delete Boolean values in an existing field item.

No

No

No

Yes (4)

Change order of Boolean values in an existing field item.

No

No

No

Yes (4)

Change item from fixed size to variable size.

No

No

No

No

Change item from variable size to fixed size.

No

No

No

No


Explanatory Notes

  1. If the record contains a filler item, the filler item can be reduced in size or eliminated altogether, and new data items and group items can be added in the space made available.

    The size of the record must not change. Thus, the filler item must be reduced in size or eliminated to produce the proper size area. Filler items are similar to alpha items. Their size is specified in 8‑bit bytes, they are aligned on byte boundaries, and they are initialized to all bits on. Regardless of the position of the filler item declaration, the filler in the record is located after all data items and group items, and before all control items.

    Items added to a fixed-format record must be added at the end of the record. Items added to the fixed part of a variable-format record must be added at the end of the fixed part. Items added to the variable part must be added at the end of the variable part.

    New items can be required and must not specify a null initial value. If new items are required, a reorganization also is required. If the new items are required and an initial value is not specified or the initial value is null, a data error occurs during the reorganization. All items added to existing records have the initial value of all bits on. This includes Boolean items and field items. All items in newly created records have normal initial values.

    Since the filler item starts on an 8‑bit byte boundary, the first newly added item must start on a byte boundary also. If an unused 4‑bit digit precedes the filler, the first new item is not properly byte aligned. In this case, the error message “ITEM ADDED” or “ITEM MISMATCH” results. To avoid this problem, ensure that the first added item is byte aligned. For example, if one of the new items is an alpha item or group item, put it first. Otherwise, the first new item must be inserted in a dummy group item.

  2. If the change of the REQUIRED option for an item does not affect the location of the first REQUIRED option, it can be used with a DASDL update process. For example, assume the original DASDL description looks as follows:

    D DATASET
    REQUIRED ALL
    (D1    NUMBER(6);
     D2    ALPHA(12);
     D3    NUMBER(6);
    );
    S SET OF D KEY IS D1;

    And the DASDL description is changed to the following:

    UPDATE;
    D DATASET
    (D1    NUMBER(6);
     D2    ALPHA(12);
     D3    NUMBER(6);
    );
    S SET OF D KEY IS D1;

    D1 is implicitly required in data set D because it is the key of set S. Since the location of the first required item (D1) did not change, a reorganization is not required.

  3. When an item is made required, the user must ensure that the item has a valid value in every data set record. The Reorganization program terminates with an error if it encounters a required item containing a null value.

  4. 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.

    Occurrences of an item or a group can be increased or decreased. An OCCURS clause can be added or deleted. Data is lost when occurrences are decreased. When occurrences are increased, items or groups in the new data set record with no source in the old data set record are filled with the appropriate initial value.

    If the size of an item or an occuring item within the group is changed, then it is possible that the generated reorganization text that is required to move the data from the old field to the new field might exceed the maximum allowable size. If this happens, the DASDL compiler issues the following error:

    THIS REORGANIZATION CANNOT BE DONE
    LENGTH OF TEXT REQUIRED FOR REORG EXCEEDS THE MAXIMUM

    Other methods, such as using the LOADDUMP utility, can be used to accomplish this reorganization.

  5. If a data item is deleted from a data set or from global data, the data item must also be deleted from all remaps which include it.

  6. An error occurs if you add a new item to an existing data set and use the new item as the key for a new set. The error occurs because, by default, all values of the item are initially null. To avoid this error, complete either of the following actions:

  • Perform two reorganizations, that is:

    1. Add the new item to the DASDL source file and perform a reorganization.

    2. Update the database to assign values to the new item.

    3. Add the new set to the DASDL source file and perform a second reorganization.

  • Allow duplicates in the set, that is:

    1. Add the new item to the DASDL source file and assign an initial value.

      An initial value is treated differently from a null value and does not cause the reorganization to fail.

    2. Include the DUPLICATES ALLOWED option in the new set declaration.

    3. Perform a reorganization.