Previous Topic: Adding and Dropping Set PointersNext Topic: Changing Set Membership Options


Changing Set Order

Types of changes

You can make the following order-related changes:

What components are affected

When you change NEXT, PRIOR, FIRST, LAST, or SORTED specifications, the schema set definition and data are affected. Subschemas and access modules that reference either the owner or member records area are also affected.

Steps to change set order

Follow the steps listed in 33.2, "Modifications to an Unloaded Database" at the beginning of this chapter if both of the following statements are true:

Steps to re-order chain and unsorted indexed sets

To change the set order of a chained or unsorted indexed set, member records must be re-ordered:

  1. Create a new schema based on the original
  2. Modify the set to change the set order
  3. Validate the schema
  4. Create a global subschema
  5. Write a conversion program that disconnects and re-orders (in the desired sequence) each member record occurrence
  6. Complete the process by updating the original schema, regenerating affected subschemas and altering affected access modules

Steps to re-order sorted indexed sets

To change the sort key of a sorted indexed set or to change an indexed set from unsorted to sorted and vice versa, follow the procedure for re-ordering chain sets except replace Step 5 with the following:

  1. Write a program that sweeps the area and call IDMSTBLU with a REBUILD function
  2. Use the output from the step above as input to MAINTAIN INDEX and run MAINTAIN INDEX from SORT3

Considerations

When you change the set order from or to SORTED or when you change the sort key of a sorted set, the control length of the member record may change. If it does, and the member record is compressed or variable in length, you must use RESTRUCTURE to change the control length of existing record occurrences.