Manually coding IDMSRSTT macros to nullify set pointers
search cancel

Manually coding IDMSRSTT macros to nullify set pointers

book

Article ID: 436292

calendar_today

Updated On:

Products

IDMS

Issue/Introduction

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.

Environment

Release: All supported releases.

Resolution

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:

  • The two values in the BUFSIZE call must be the same and at least as large as the longest of the involved records (including data and prefix).
  • For each record type, there must be a SETPTR call for every pointer position (identified by the new-position value) in the record, even those whose value is not being changed.
  • In the owner record, old-position must be * for the pointers of the relevant set.
  • In the member record, old-position must be left blank for the pointers of the relevant set.
  • For all other sets in both record types, old-position must be the same as new-position.
  • For CALC records, the CALC pointers positions are not to be included when determining pointer position numbers.

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

Additional Information

JCL to link-edit the IDMSSRTT statements (scroll down to IDMSRSTT)
JCL to run the linked statements (scroll down to RESTRUCTURE)