Resource recovery token
A 16-byte recovery token is used to uniquely identify a unit of work across all subsystems to which the application has thread connections. IMS passes the token to the Signon exit routine before the thread is created.
For commit and resolve indoubt processing, IMS passes the recovery token to identify the unit of work for which the requested action is to be taken.
The recovery token is constructed as shown in the following figure.

- IMS-id
- Is the IMS system ID (1 to 4 characters), left justified and padded with blanks on the right to eight bytes.
- OASN
- Is a 4-byte binary origin application sequence number assigned to the application when it is scheduled. The OASN is assigned based on the scheduling order within the IMS system since the last cold start. It is also referred to as the application schedule number.
- commit_number
- Is a 4-byte binary commit number. The commit number is initialized to binary zeroes when the application is scheduled and then incremented after each commit is processed for the application.
The external subsystem should check the recovery token passed at signon for uniqueness. Cold starts of IMS can cause a recovery token to be generated that is a duplicate of a recovery token that is indoubt in the external subsystem. The Signon exit routine can indicate to IMS that the recovery token passed was found to be a duplicate, in which case IMS terminates the application program with an abend. The Commit Prepare exit routine can also indicate that the token is a duplicate that supports external subsystems that choose not to associate the recovery token with the unit of work until commit is processed.
The installation uses the /DISPLAY SUBSYS command with the OASN keyword to determine what units of work are in indoubt status in IMS. The installation can use the /CHANGE command (when necessary) to manually delete indoubt units of work in IMS. The /CHANGE command only affects unit of work status in IMS. There is no communication with the external subsystem. These commands use only the OASN and not the full recovery token; /DISPLAY lists only the OASN portion of the recovery token (in decimal format) and /CHANGE accepts just the OASN (again in decimal format). (Within IMS, the OASN is unique across all known units of work.)