- CTXRCC is for AMODE(31) callers.
- CTX4RCC is for AMODE(64) callers and allows parameters in 64 bit
addressable storage.
A resource manager calls the Retrieve_Current_Context_Token service
to obtain the context token for the currently active context. The
token can be used in subsequent calls to other context services to
identify that context.
Note: The Retrieve_Current_Context_Token service is intended to be
used to obtain the context token of the active context of
the current dispatchable unit of work.
Environment
The requirements for the resource
manager are:
Minimum authorization: |
None |
Dispatchable unit mode: |
Task mode |
Cross memory mode: |
Any PASN, any HASN, any SASN |
AMODE: |
31 bit (CTXRCC)
64 bit (CTX4RCC)
|
ASC mode: |
Primary or AR |
Interrupt status: |
Enabled for I/O and external interrupts |
Locks: |
Unlocked |
Control parameters: |
Control parameters must be in the
primary address space and addressable by the resource manager. |
Programming requirements
Either link edit
the resource manager's object code with the linkable stub routine
CTXCSS (31 bit) or CTX4CSS (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 |
---|
CTXASM |
390 Assembler declarations |
CTXC |
C/390 declarations |
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.
CALL CTXRCC
|
(return_code
,context_token)
|
CALL CTX4RCC
|
(return_code
,context_token)
|
Parameters
The parameters are explained
as follows:
- return_code
- Returned parameter
- Type: Integer
- Character Set: N/A
- Length: 4 bytes
Provides the return code for the call.
- ,context_token
- Returned
parameter
- Type: Character string
- Character Set: No restriction
- Length: 16 bytes
The context_token identifies the context that is currently
active.
ABEND codes
The call might result in an
abend X'AC7' with a reason code of either X'00220000' or X'00220001'.
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 hexadecimal return code.
Return Code in:
Hexadecimal
Equate Symbol
|
Meaning and action |
---|
0
CTX_OK
|
Meaning: Successful completion.
Action: None.
|
103
CTX_INTERRUPT_INV
|
Meaning: Program error. The
caller is disabled. The system rejects the service call. Action:
Check program logic for probable coding error. Correct the problem
and reissue service.
|
104
CTX_MODE_INV
|
Meaning: Program error. The
caller is not in task mode. The system rejects the service call. Action:
Check program logic for probable coding error. Correct the problem
and reissue service.
|
105
CTX_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
CTX_UNSUPPORTED_RELEASE
|
Meaning: The release of MVS™ does not support this service.
The service stub has been linked on a system that does not support
the correct level of Context Services. Action: Remove the
resource manager from the system, and install it on a system that
supports the correct level of Context Services. Then rerun the resource
manager.
|
36A
CTX_DU_TERMINATING
|
Meaning: Program error.
The dispatchable unit associated with the specified context is terminating.
The system rejects the service call. Action: Check the
resource manager for a probable coding error. Correct the resource
manager and rerun it.
|
FFF
CTX_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, the
resource manager issues a call to retrieve the context token of the
current context. Storage for the call parameters has been allocated.
⋮
C_TOKEN = ''B;
CALL CTXRCC(RC,C_TOKEN);
IF RC ¬= CTX_OK THEN
/* handle error situation */
⋮