In the event of a heavily corrupted chained set, it can be impractical to attempt to fix the pointers with FIX PAGE. If it is possible to determine the set linkage between the owners and members programmatically from the data, then part of the process normally used to run a RESTRUCTURE can be used to nullify all of the involved set's pointers. The database is then valid from the perspective of a program's capacity to read it, and so a user program could then be written to re-construct the set linkage. This article describes how to manually code the IDMSRSTT macros necessary to nullify all of a chained set's pointers.
Release: All supported releases.
In this example, the DEPT-EMPLOYEE set of the sample database is used. These instructions describe how to forcibly set all of the NEXT and PRIOR pointers in the owning DEPARTMENT records to the dbkey of itself, thereby indicating that they all own empty sets. It will also set all of the NEXT, PRIOR and OWNER pointers of the member EMPLOYEE records to x'FFFFFFFF' indicating that they are all not a member of any instance of the set.
Normally, the IDMSRSTC utility generates IDMSRSTT source for a restructure by comparing an OLD and a NEW schema. For this process, no real restructure is being performed so no IDMSRSTC execution is necessary - all that is happening is that the pointers are being nullified.
The IDMSSRTT source to nullify the DEPT-EMPLOYEE set would be this:
IDMSRSTT BUFSIZE=(400,400) IDMSRSTT RECNAME=DEPARTMENT IDMSRSTT SETPTR=(*,1) IDMSRSTT SETPTR=(*,2) IDMSRSTT FIELD=ALL IDMSRSTT RECNAME=EMPLOYEE IDMSRSTT SETPTR=(,1) IDMSRSTT SETPTR=(,2) IDMSRSTT SETPTR=(,3) IDMSRSTT SETPTR=(4,4) IDMSRSTT SETPTR=(5,5) IDMSRSTT SETPTR=(6,6) IDMSRSTT SETPTR=(7,7) IDMSRSTT SETPTR=(8,8) IDMSRSTT SETPTR=(9,9) IDMSRSTT SETPTR=(10,10) IDMSRSTT SETPTR=(11,11) IDMSRSTT SETPTR=(12,12) IDMSRSTT SETPTR=(13,13) IDMSRSTT SETPTR=(14,14) IDMSRSTT SETPTR=(15,15) IDMSRSTT SETPTR=(16,16) IDMSRSTT FIELD=ALL IDMSRSTT END END
Considerations:
Note: The user program written to re-connect the members and owners will need to use a temporary subschema with the set defined as OPTIONAL MANUAL (if it is not already).
JCL to link-edit the IDMSSRTT statements (scroll down to IDMSRSTT)
JCL to run the linked statements (scroll down to RESTRUCTURE)