z/OS MVS Programming: Resource Recovery
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Unregister_Resource_Manager (CRGDRM, CRG4DRM)

z/OS MVS Programming: Resource Recovery
SA23-1395-00

  • CRGDRM is for AMODE(31) callers.
  • CRG4DRM is for AMODE(64) callers and allows parameters in 64 bit addressable storage.

A resource manager calls the Unregister_Resource_Manager service to unregister itself explicitly. In response to the call, the system returns a return code.

Explicit and Implicit Unregistration: Normally, when a resource manager is ending processing, it issues a call to unregister itself. The call can be issued from any address space. If your resource manager does not explicitly unregister, the system implicitly unregisters it as follows, depending on the unregister_option specified in the call to the Register_Resource_Manager service that registered the resource manager:
  • When the resource manager's task ends. The resource manager runs as a task in the home address space.
  • When the cross memory resource-owning task of the resource manager ends. This task is the top, or first, job step task in the home address space.
  • When the resource manager's address space ends.

The system can also unregister a resource manager because of errors, such as consecutive exit errors.

Environment

The requirements for the resource manager are:

Programming requirements

The resource manager does not have to issue the call to the Unregister_Resource_Manager service from the same task and address space in which it issued the corresponding call to the Register_Resource_Manager service.

Either link edit your object code with the linkable stub routine CRGCSS (31 bit) or CRG4CSS (64 bit) from SYS1.CSSLIB, or LOAD and CALL the service. The high level language (HLL) definitions for the callable service are:

HLL Definition Description
CRGASM 390 Assembler declarations
CRGC C/390 declarations

Restrictions

The state of the resource manager associated with the resource manager token specified must be registered, set, reset, or run. After a successful call, the resource manager state is unregistered.

Resource managers that are PKM 8–15 problem state must register using the Register_Resource_Manager service from the home address space before invoking this service. They must specify a resource manager token of a key 8–15 problem state resource manager that registered from the home address space.

Input register information

Before issuing the call, the resource manager does not have to place any information into any register unless using it in register notation for the parameters, or using it as a base register.

Output register information

When control returns to the resource manager, the GPRs contain:
Register
Contents
0-1
Used as work registers by the system
2-13
Unchanged
14
Used as a work register by the system
15
Return code
When control returns to the resource manager, the ARs contain:
Register
Contents
0-1
Used as work registers by the system
2-13
Unchanged
14-15
Used as work registers by the system

Some resource managers depend on register contents remaining the same before and after issuing a call. If the system changes the contents of registers on which the resource manager depends, the resource manager must save them before calling the service, and restore them after the system returns control.

Performance implications

None.

Syntax

Write the call as shown in the syntax diagram. You must code the parameters in the CALL statement as shown.

Parameters

The parameters are explained as follows:
return_code
Returned parameter
  • Type: Integer
  • Character Set: N/A
  • Length: 4 bytes

Contains the return code from the Unregister_Resource_Manager service.

,resource_manager_token
Supplied parameter
  • Type: Character string
  • Character Set: No restriction
  • Length: 16 bytes

Specifies the resource manager token that uniquely identifies the resource manager. Your resource manager received the token from the Register_Resource_Manager service.

ABEND codes

The call might result in an abend X'AC7' with a reason code of either X'00310000' or X'00310001'. See z/OS MVS System Codes for the explanations and actions.

Return codes

When the service returns control to the resource manager, GPR 15 and return_code contain a return code.

Return Code in:
Hexadecimal
Equate Symbol

Meaning and action

0
CRG_OK

Meaning: Successful completion.

Action: None.

103
CRG_INTERRUPT_STATUS_INV

Meaning: Program error. The resource manager is disabled; the interrupt status must be enabled for I/O and external interrupts. The system rejects the service call.

Action: Check the resource manager for a probable coding error. Correct the resource manager and rerun it.

105
CRG_LOCKS_HELD

Meaning: Program error. The resource manager is holding one or more locks; no locks must be held. The system rejects the service call.

Action: Check the resource manager for a probable coding error. Correct the resource manager and rerun it.

107
CRG_UNSUPPORTED_RELEASE

Meaning: Environmental error. The system release does not support this service. The system rejects the service call.

Action: Remove the resource manager from the system, and install it on a system that supports registration services. Then rerun the resource manager.

301
CRG_RM_TOKEN_INV

Meaning: Program error. The resource manager token specified in the call is not one of the currently valid resource manager tokens. The system rejects the service call.

Action: Check the resource manager for a probable coding error. Correct the resource manager and rerun it.

756
CRG_AUTH_FAILURE

Meaning: Program error. The resource manager is PKM 8–15 problem state and specified a resource manager token that does not belong to a PKM 8–15 problem state resource manager registered in the home address space. The system rejects the service call.

Action: Check the calling program for a probable coding error. Correct the calling program and rerun it.

FFF
CRG_UNEXPECTED_ERROR

Meaning: System error. The service that was called encountered an unexpected error. The system rejects the service call.

Action: Search problem reporting databases for a fix for the problem. If no fix exists, contact the IBM® Support Center.

Example

In the pseudocode example, a resource manager issues a call to unregister itself.
⋮
RM_TOKEN = MY_RM_TOKEN
CALL CRGDRM(RC,RM_TOKEN)
⋮

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014