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


Set_Environment (ATRSENV, ATR4SENV)

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

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

A work manager calls the Set_Environment service to establish environmental settings for RRS, but RRS need not be available when the service is called. Typically, a work manager calls Set_Environment to establish transaction default modes for the primary address space scope and context-specific scopes. The work manager can also specify that the settings it chooses are to be protected against change by unauthorized programs. The work manager can direct RRS to establish the default transaction mode and the default two-phase commit action.

Calling any of the following services will cause a UR state to go from in-reset to in-flight, setting a transaction mode for that UR:
  • Create_Cascaded_UR
  • Express_UR_Interest
  • Retrieve_Work_Identifier
  • Set_Side_Information
  • Set_Work_Identifier
Note that calls to Create_Cascaded_UR, Retrieve_Work_Identifier, or Set_Work_Identifier will never cause a UR to have a local transaction mode.
Establish the default transaction mode: The default transaction mode determines the transaction mode for an in-reset UR when the first expression of interest occurs. The first expression of interest establishes the transaction mode for the UR; the transaction mode cannot change for the life of the UR. The possible transaction modes are:
  • ATR_LOCAL_MODE: Sets local transaction mode as the default for implicitly-started transactions
  • ATR_GLOBAL_MODE: Sets global transaction mode as the default for implicitly-started transactions
  • ATR_HYBRID_GLOBAL_MODE: Sets hybrid-global transaction mode as the default for implicitly-started transactions. Hybrid-global mode is the same as global except that it allows resource managers to exhibit proprietary transactional behavior. Hybrid-global is the default transaction mode in the absence of an applicable environment setting for a given UR. A resource manager that does not have any proprietary behaviors can treat hybrid-global transaction mode as global.
  • ATR_NOT_SET: Removes the default transaction mode previously set for this scope (address space or context). The result of ATR_NOT_SET is the same as if Set_Environment for this scope had never been issued.
Note that applications cannot use Begin_Transaction to explicitly start a new transaction when the transaction mode environment is either not set (ATR_NOT_SET) or set to hybrid-global (ATR_HYBRID_GLOBAL_MODE).

Because the work manager can establish environmental settings for both address space scope and context scope, conflicting values might apply to a given UR. RRS uses the following precedence list to resolve conflicting settings:

  1. Context scope transaction default (protected or not)
  2. Home address space scope default (protected or not)
  3. RRS system default
Note: It is important to distinguish that, for address space scope specifications when zero is specified for stoken, the Set_Environment service affects the primary address space, while the Retrieve_Environment service relates to the home address space.
Establish default two-phase commit actions: The work manager can provide a separate direction to RRS to commit or roll back URs when the UR state is still in-flight for the following event:
  • ATR_NORM_CTX_END_SETTING RRS is to take a prescribed action when a UR's associated context goes through normal termination. The default action is to commit the UR.

Environment

The requirements for the caller are:

Programming requirements

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

HLL definition Description
ATRRASM 390 Assembler declarations
ATRRC C/390 declarations

Restrictions

The following restrictions are placed on unauthorized (PKM 8–15 problem state) callers. These callers:
  • Must specify ATR_UNPROTECTED_SETTING for the protection_level parameter.
  • Cannot change any environmental settings established (by an authorized caller) with ATR_PROTECTED_SETTING for each element of the environment_protection parameter.
  • Can change an address space scope setting only when that space is the primary address space (the stoken parameter is 0) and the setting is unprotected.
  • Can change a context scope setting only when:
    • The context is current, the setting is unprotected, and the home address space scope setting is unprotected.
    • The context is not current, the setting is unprotected, the context is owned by a key 8–15 problem state work manager registered in the home address space, and the home address space scope setting is unprotected.

SRB mode callers cannot specify a context token of 0 when trying to establish environment settings at the context scope (ATR_CONTEXT_SCOPE).

Input register information

Before issuing the call, the caller 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 caller, 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 caller, 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 callers depend on register contents remaining the same before and after issuing a call. If the system changes the contents of registers on which the caller depends, the caller 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 Set_Environment service.

,diag_area
Returned parameter
  • Type: Character string
  • Character Set: No restriction
  • Length: 32 bytes

Contains diagnostic data from Set_Environment to help IBM® Service determine the cause of a Set_Environment failure. Be sure to log this data when recording any information about a Set_Environment failure.

,scope
Supplied parameter
  • Type: Integer
  • Character Set: N/A
  • Length: 4 bytes
Specifies the scope of the environmental setting value(s), either address space scope or context scope, as follows:

Constant in:
Hexadecimal
(Decimal)
Equate Symbol

Description

1
(1)
ATR_ADDRESS_SPACE_SCOPE

The environmental setting has address space scope for the address space represented by the token in the stoken parameter.

2
(2)
ATR_CONTEXT_SCOPE

The environmental setting applies for the context represented by the token in the context_token parameter.
,context_token
Supplied parameter
  • Type: Character string
  • Character Set: No restriction
  • Length: 16 bytes
Specifies the token of the context for which the resource manager is establishing context scope environment settings:
  • 0: Binary zeros specify either:
    • The current context (when scope is ATR_CONTEXT_SCOPE)
    • No context (when scope is ATR_ADDRESS_SPACE_SCOPE)
    If scope is ATR_ADDRESS_SPACE_SCOPE, then context_token must be 0.
  • token: Specifies a valid context token.
,stoken
Supplied parameter
  • Type: Character string
  • Character Set: No restriction
  • Length: 8 bytes
Specifies the space token (stoken) of the address space for which the resource manager is establishing address space scope environment settings:
  • 0: Binary zeros indicate the primary address space (required for unauthorized callers). If scope is ATR_CONTEXT_SCOPE, then stoken must be 0.
  • token: Specifies a valid address space token.
Note: If an unauthorized caller in cross-memory mode specifies 0, the system rejects the call.
,element_count
Supplied parameter
  • Type: Integer
  • Character Set: N/A
  • Length: 4 bytes

Specifies the number of elements in the environment-setting array, which consists of the environment_id, environment_value, and environment_protection parameters.

The maximum number of elements is the number of possible environment settings (transaction mode and two-phase commit action) times the number of environment-setting parameters. The maximum number is 2.

,environment_id
Supplied parameter
  • Type: Integer
  • Character Set: N/A
  • Length: 4 bytes
Specifies one or more identifiers; each identifier supplies an environment attribute that is to be set. When you specify more than one identifier, you must define an array; element_count indicates the number of elements in the array. The positions of the identifiers in this array define the positions of the environment attributes in the environment-setting array. The scope parameter specifies the scope at which these settings are to apply. Specify each identifier as one of the following:

Identifier in:
Hexadecimal
(Decimal)
Equate Symbol

Description

1
(1)
ATR_TRAN_MODE_SETTING

The service is to set the transaction mode.

2
(2)
ATR_NORM_CTX_END_SETTING

The service is to set the two-phase commit action RRS should take for in-flight URs when the associated context goes through normal end processing.
Note: This setting does not apply to a cascaded (child) UR. The outcome of the entire syncpoint tree is determined by the environmental setting of only the top-level UR, not any of the child URs.
,environment_value
Supplied parameter
  • Type: Integer
  • Character Set: N/A
  • Length: 4 bytes

Supplies a value for each identifier on the environment_id parameter. When you specify more than one identifier, you must define an array, where element_count indicates the number of elements in the array. The positions of the identifiers in the environment_id array define the positions of the environment attributes in the environment_value array.

Specify the value for ATR_TRAN_MODE_SETTING as one of the following:

Value in:
Hexadecimal
(Decimal)
Equate Symbol

Description

0
(0)
ATR_NOT_SET

The transaction mode environment setting for this environment_id (address space or context) is to be removed. Setting this value makes it as if Set_Environment (for the environment_id specified) was never issued.

1
(1)
ATR_GLOBAL_MODE

The transaction mode is set to global for the requested scope.

2
(2)
ATR_LOCAL_MODE

The transaction mode is set to local for the requested scope.

3
(3)
ATR_HYBRID_GLOBAL_MODE

The transaction mode is set to hybrid-global for the requested scope. This is the same as global mode, except it allows the resource manager to exhibit proprietary connection behavior.
Specify the value for ATR_NORM_CTX_END_SETTING as one of the following:

Value in:
Hexadecimal
(Decimal)
Equate Symbol

Description

0
(0)
ATR_NOT_SET

The environment setting at this environment_id (address space or context) is removed. Setting this value makes it as if Set_Environment (for the environment_id specified) was never issued.

1
(1)
ATR_COMMIT_ACTION

RRS is to commit in-flight URs.

2
(2)
ATR_ROLLBACK_ACTION

RRS is to roll back in-flight URs.
,environment_protection
Supplied parameter
  • Type: Integer
  • Character Set: N/A
  • Length: 4 bytes

Supplies a protection value for each identifier in the environment_id parameter. When you specify more than one identifier, you must define an array, where element_count indicates the number of elements in the array. The positions of the identifiers in the environment_id array define the positions of the environment attributes in the environment_protection array.

Only an authorized caller can set the protection value. By setting ATR_PROTECTED_SETTING, authorized callers can prevent unauthorized callers from changing the environmental settings. Specify each element as one of the following:

Value in:
Hexadecimal
(Decimal)
Equate Symbol

Description

1
(1)
ATR_UNPROTECTED_SETTING

An unauthorized caller can change the settings specified in the corresponding element in the environment_value array.

2
(2)
ATR_PROTECTED_SETTING

Only an authorized caller can change the settings specified in the corresponding element in the environment_value array.

ABEND codes

The call might result in an abend X'5C4' with a reason code of either X'00260000' or X'00260001'. 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
ATR_OK

Meaning: Successful completion. The environment has been set as desired.

Action: None.

103
ATR_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.

104
ATR_MODE_INV

Meaning: Program error. The calling program is not in task mode, specified a zero context token, and attempted to set environment settings at a scope of ATR_CONTEXT_SCOPE. The system rejects the service call.

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

105
ATR_LOCKS_HELD

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

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

107
ATR_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 is running a version of RRS that supports this service call. Then rerun the resource manager.

361
ATR_CONTEXT_TOKEN_INV

Meaning: Program error. The context token specified in the call is not valid. The system rejects the service call.

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

362
ATR_STOKEN_INV

Meaning: Program error. The address space token specified in the call is not valid. The system rejects the service call.

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

364
ATR_ENV_SETTING_ID_INV

Meaning: Program error. A value in the environment_id parameter specified in the call is not valid. The system rejects the service call.

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

365
ATR_ENV_SETTING_INV

Meaning: Program error. A value in the environment_value parameter specified in the call is not valid. The system rejects the service call.

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

366
ATR_SCOPE_INV

Meaning: Program error. The scope specified in the call is not valid. The system rejects the service call.

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

36B
ATR_ACTION_INV

Meaning: Program error. The value specified for ATR_NORM_CTX_END_SETTING in the call is not valid. The system rejects the service call.

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

36C
ATR_PROTLEVEL_INV

Meaning: Program error. The environment setting protection value in the call is not valid. The system rejects the service call.

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

392
ATR_ELEMENT_COUNT_INV

Meaning: Program error. The element count value in the call is not valid. The system rejects the service call.

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

3AB
ATR_AUTH_FAILURE

Meaning: Program error. An unauthorized caller tried to change a setting for an authorized context other than the current context. The system rejects the service call.

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

801
ATR_SETTING_PROTECTED

Meaning: Program error. An unauthorized caller tried to change a setting that was protected by an authorized caller. The system rejects the service call.

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

802
ATR_STOKEN_NOT_ZERO

Meaning: Program error. The stoken parameter was incorrectly specified. One of the following is true:
  • The stoken is not zero, but the caller specified ATR_CONTEXT_SCOPE on the scope parameter; or,
  • The stoken is not zero and the caller is unauthorized.
In either case, the system rejects the service call.

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

803
ATR_CTOKEN_NOT_ZERO

Meaning: Program error. The context token parameter was incorrectly specified. The caller specified ATR_ADDRESS_SPACE_SCOPE on the scope parameter and a non-zero value on the context token parameter. The system rejects the service call.

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

FFF
ATR_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 work manager issues a call to establish environmental settings for RRS.
⋮
SCOPE = ATR_CONTEXT_SCOPE
C_TOKEN = MY_CONTEXT_TOKEN
A_TOKEN = 0
ELE_CNT = 1
ENV_SET_ID = ATR_NORM_CTX_END_SETTING
ENV_SET = ATR_COMMIT_ACTION
ENV_SET_PROT = ATR_PROTECTED_SETTING
CALL ATRSENV(RC,DIAG_DATA,SCOPE,C_TOKEN,A_TOKEN,ELE_CNT,
            ENV_SET_ID,ENV_SET,ENV_SET_PROT)
⋮

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014