An IDMS network database may have a chained set defined as sorted, with an existing sortkey. A need may arise to change that sortkey, indicating a new sort sequence for the set. What utility can be used to accomplish this? Unload/Reload? Reorg? Restructure? How can this change be done?
Release: All supported releases.
The unload/reload utility statements will not handle this, and neither will any other utility.
There are two cases to consider.
The first program would read the records as is, using the old sortkey definition, area sweeping on the owner record. For each owner record, walk the set, writing the owner and member dbkeys to a flat file, then disconnecting the member record from the set. If the set is defined as Mandatory Automatic, create a temporary schema/subschema that defines the set as Optional Manual for the DISCONNECT to work. Then the program should re-get the owner record to re-establish currency for the area sweep. (This part is not necessary if the owner and member records are in different areas.)
After the first program is complete, make the necessary changes to the schema/subschema, changing the set definition to specify the new sortkey fields. In the new schema/subschema pair, the set should be defined (for now) as OPTIONAL MANUAL.
The second program must read the flat file created above, get currency on the owner and member records, then issue a CONNECT to join the member to the owner. The member will be connected in the correct (new) set order.
When that program is done executing, modify the new schema/subschema set definition back to Mandatory Automatic if needed.
The sample programs provided in the following Knowledge Documents were created for a slightly different purpose, but can be used as a basis for this exercise.
How to convert a sorted set to a user-owned index
Utility program to help rebuild user-owned indexed set
Be careful using sorted chained sets - see Sorted chained sets should be used with caution.