RESMGR allows an authorized program to add (ADD parameter) or delete (DELETE parameter) a resource manager routine.
For information about the uses of resource managers, see z/OS MVS Programming: Authorized Assembler Services Guide.
The requirements for the caller are:
Environmental factor | Requirement |
---|---|
Minimum authorization: | Supervisor state or PKM allowing key 0 - 7 |
Dispatchable unit mode: | Task or SRB. However, you cannot issue TCB=CURRENT in SRB mode. |
Cross memory mode: | Any PASN, any HASN, any SASN |
AMODE: | 24- or 31-bit |
ASC mode: | Primary or access register (AR) |
Interrupt status: | Enabled for I/O and external interrupts |
Locks: | The caller can hold the local lock, depending
on whether the caller is in noncross memory mode or cross memory mode:
If the caller holds a local lock, it can also hold the CMS lock. |
Control parameters: | Must be in the primary address space |
None.
None.
Before issuing the RESMGR macro, the caller does not have to place any information into any register unless using it in register notation for a particular parameter, or using it as a base register.
Some callers depend on register contents remaining the same before and after issuing a service. If the system changes the contents of registers on which the caller depends, the caller must save them before issuing the service, and restore them after the system returns control.
The LINK option on the ROUTINE parameter might degrade the performance of the system during task and address space termination.
If you specify TCB=ALL and ASID=ALL, the system invokes the resource manager program for every task termination initiated by the system. You can improve system performance by specifying a particular task or ASID.
The standard form of the RESMGR macro is written as follows:
Syntax | Description |
---|---|
name | name: Symbol. Begin name in column 1. |
␢ | One or more blanks must precede RESMGR. |
RESMGR | |
␢ | One or more blanks must follow RESMGR. |
ADD | |
DELETE | |
,TOKEN=tokaddr | tokaddr: A-type address or register (2) - (12). |
,TYPE=ADDRSPC | |
,TYPE=TASK | |
,ASID=CURRENT | asid: A constant or register (2) - (12). |
,ASID=ALL | |
,ASID=asid | |
,TCB=CURRENT | |
,TCB=ALL | |
,TCB=tcbaddr | tcbaddr: A-type address or register (2) - (12). |
,TTOKEN=ttoken | ttoken: A-type address or register (2) - (12). |
,ROUTINE=(LINK, pgname) | pgname: C-type constant, A-type address, or register (2) - (12). |
,ROUTINE=(BRANCH, pgaddr) | pgaddr: A-type address or register (2) - (12). |
,ROUTINE=(PC, pcnum) | pcnum: A constant or register (2) - (12). |
,ROUTINE=(RLXPC, seqnumpcnum) |
seqnumpcnum: A-type address or register (2) - (12). |
,ECB=ecbaddr | ecbaddr: A-type address or register (2) - (12). |
,PARAM=paddr | paddr: A-type address or register (2) - (12). |
,RELATED=value | value: Any valid macro keyword specification. |
The parameters are explained as follows:
Note that you can use RESMGR to delete a resource manager from the resource manager routine itself.
If TYPE=TASK, asid must be the home or primary address space.
If your program is in cross memory mode and you want to monitor a task in the primary address space, do not specify TCB=CURRENT. In this case, specify the primary address space through ASID=asid and the task through TCB=tcbaddr or TTOKEN=ttoken.
If your program is in cross memory mode and it holds the local lock for the primary address space, it cannot request monitoring of a task in the home address space.
The section on resource managers in z/OS MVS Programming: Authorized Assembler Services Guide describes the registers on entry, the resource manager parameter list (RMPL), and some of the responsibilities of the resource manager.
If you specify PC, the resource manager receives control through a PC instruction. pcnum is the PC number of the PC instruction that gives control to the resource manager. The address space from which the resource manager is called must have the authority to issue the PC.
To code: Specify the 8-byte area, or its address in register (2) - (12).
If you specify BRANCH, the resource manager receives control in 31-bit addressing mode and in primary ASC mode through a branch instruction, and the resource manager (whether address space termination resource manager or task termination resource manager) must reside in storage addressable from all address spaces in which it can get control. Note that for address space termination, resource managers run in master's address space (ASID 1). pgaddr is the address of the resource manager.
ROUTINE is required on the ADD request.
None.
Return codes from the ADD function follow. A return code greater than 4 indicates that RESMGR did not establish a resource manager.
Decimal Return Code | Meaning and Action |
---|---|
0 | Meaning: The resource manager was successfully
established. The word provided by the TOKEN parameter contains the
token required to delete the resource manager. Action: None. |
12 | Meaning: Program error. The caller did
not provide the address of a word to contain the token of the new
resource manager. Action: Issue the macro again with the TOKEN parameter. |
16 | Meaning: Program error. The caller did
not provide the resource manager description through the ROUTINE parameter. Action: Issue the macro again with the ROUTINE parameter. |
20 | Meaning: Program error. The TCB address
provided did not represent a valid TCB. Action: Issue the macro again and ensure that the TCB address represents a valid TCB. |
24 | Meaning: Program error. The ASID provided
did not represent a valid ASCB. Action: Issue the macro again and ensure that the ASCB address represents a valid ASCB. |
28 | Meaning: Program error. The request type
was not ADD or DELETE. Action: Ensure that the parameter list created by the RESMGR macro is not inadvertently overlaid or the contents lost due to an assembler coding error. |
32 | Meaning: Environmental error. RESMGR was
unable to obtain storage for a work area it needed to process the
request. Action: Rerun your program one or more times. If the problem persists, check with the operator to see if another user in the installation is causing the problem, or if the entire installation is experiencing storage constraint problems. |
36 | Meaning: Program error. The caller held
an incorrect lock. Action: Ensure only the allowable locks are held before the macro is issued. |
40 | Meaning: Program error. It is not valid
to establish a task resource manager for a specific task that is not
in the home or primary address space of the requestor. Action: Issue the RESMGR macro for a task within the home or primary address space. |
44 | Meaning: System error. An unrecoverable
error occurred while processing the request. Action: Rerun your program one or more times. If the problem persists, record the return code and supply it to the appropriate IBM® support personnel. |
48 | Meaning: Environmental error. RESMGR was
unable to obtain storage to maintain information about RESMGR. Action: Rerun your program one or more times. If the problem persists, check with the operator to see if another user in the installation is causing the problem, or if the entire installation is experiencing storage constraint problems. |
52 | Meaning: Program error. The caller is
not authorized to use RESMGR. Action: Ensure that your program has the proper authorization. |
56 | Meaning: Environmental error. The TCB
was already terminating and no more dynamic resource managers can
be established for it. Action: Attempt to establish the resource manager before the task starts to terminate. |
60 | Meaning: Environmental error. The ASCB
was already in termination and no more dynamic resource managers can
be established for it. Action: Attempt to establish the resource manager before the address space starts to terminate. |
64 | Meaning: Program error. The TTOKEN parameter
specified a task in an address space other than the home address space. Action: Issue the RESMGR macro from within the address space of the task represented by the specified TTOKEN. |
Return codes from the DELETE function follow. A return code greater than 8 indicates that RESMGR did not delete a resource manager.
Decimal Return Code | Meaning and Action |
---|---|
0 | Meaning: The resource manager was successfully
deleted. An ECB is never posted for this return code. Action: None. |
4 | Meaning: The resource manager is currently
in use. It has been queued for deletion. The ECB, if provided, will
be posted when the delete process has completed. Action: None. |
8 | Meaning: The resource manager was queued
for deletion by a previous request. It is still active and will be
deleted as soon as it is no longer in use. Action None. |
12 | Meaning: Program error. The caller did
not provide a token to RESMGR. Action: Specify the TOKEN parameter and value that represents the resource manager to be deleted. |
16 | Meaning: Program error. The token provided
did not represent a currently established resource manager. Action: Ensure that the token was properly saved after the resource manager was established. Also ensure that the resource manager had not previously been deleted either directly through RESMGR or indirectly through task or address space termination. |
20 | Meaning: Program error. The TCB address
provided did not represent a valid TCB. Action: Ensure that the TCB represents a valid TCB within the home address space. |
24 | Meaning: Program error. The ASID provided
did not represent a valid ASCB. Action: Ensure that the ASCB address represents a valid ASCB. |
28 | Meaning: Program error. The request type
was not ADD or DELETE. Action: Ensure that the parameter list created by the RESMGR macro was not inadvertently overlaid or its contents lost due to an assembler coding error. |
32 | Meaning: Environmental error. RESMGR was
unable to obtain storage for a work area it needed to process the
request. Action: Rerun your program one or more times. If the problem persists, check with the operator to see if another user in the installation is causing the problem, or if the entire installation is experiencing storage constraint problems. |
36 | Meaning: Program error. The caller held
an incorrect lock. Action: Ensure only the allowable system locks are held prior before the macro is issued. |
40 | Meaning: Program error. It is not valid
to delete a task resource manager for a specific task that is not
in the home or primary address space of the requestor. Action: Issue the RESMGR macro again for a task within the home or primary address space. |
44 | Meaning: System error. An unrecoverable
error occurred while processing the request. Action: Rerun your program one or more times. If the problem persists, record the return code and supply it to the appropriate IBM support personnel. |
48 | Meaning: Program error. The ECB parameter
was specified but is not supported for the particular type of delete
request. Action: Refer to the ECB parameter description to ensure proper usage of this parameter. |
52 | Meaning: The caller is not authorized
to use RESMGR. Action: Ensure that your program has the proper authorization. |
64 | Meaning: Program error. The TTOKEN parameter
specified a task in an address space other than the home address space. Action: Issue the RESMGR macro from within the address space of the task represented by the specified TTOKEN. |
RESMGR ADD,TOKEN=MYTOKEN,TYPE=ADDRSPC,ASID=ALL,
ROUTINE=(LINK,'IAMARESM')
RESMGR ADD,TOKEN=MYTOKEN,TYPE=TASK,ASID=ALL,TCB=ALL,
ROUTINE=(LINK,'IAMARESM')
L R2,RMADDR Obtain address of resource manager routine
RESMGR ADD,TOKEN=MYTOKEN,TYPE=TASK,ASID=ALL,
TCB=ALL,ROUTINE=(BRANCH,(R2))
EXTRN RMROUTIN
RMADDR DC A(RMROUTIN) Address of resource manager routine