IEAN4RT — Retrieve the token from a name/token pair

Description

Call the IEAN4RT service to retrieve the token from a name/token pair.

The IEAN4RT callable service can also be used to obtain the name of the logrec medium, either the name of the logrec data set or the name of the logrec log stream.

Environment

The requirements for the caller are:

Environmental factor Requirement
Minimum authorization: Problem state, with any PSW key
Dispatchable unit mode: Task or SRB
Note: SRB-mode callers cannot retrieve a task-level pair.
Cross memory mode: Any PASN, any HASN, any SASN
AMODE: 64-bit
ASC mode: Primary or access register (AR)
Interrupt status: Enabled for I/O and external interrupts
Locks: The caller can hold a local, CML, or CMS lock; however, no locks are required.
Control parameters: The parameter list and all parameters must reside in the caller's primary address space.

Programming requirements

Before you use name/token services, you can optionally include macro IEANTASM to invoke name/token services equate (EQU) statements. IEANTASM provides the following constants for use in your program:
* Name/Token Level Constants
*
IEANT_TASK_LEVEL             EQU     1
IEANT_HOME_LEVEL             EQU     2
IEANT_PRIMARY_LEVEL          EQU     3
IEANT_SYSTEM_LEVEL           EQU     4
IEANT_TASKAUTH_LEVEL         EQU     11
IEANT_HOMEAUTH_LEVEL         EQU     12
IEANT_PRIMARYAUTH_LEVEL      EQU     13
*
* Name/Token Persistence Constants
*
IEANT_NOPERSIST              EQU     0
IEANT_PERSIST                EQU     1
*
* Name/Token Return Code Constants
*
IEANT_OK                     EQU     0
IEANT_DUP_NAME               EQU     4
IEANT_NOT_FOUND              EQU     4
IEANT_24BITMODE              EQU     8
IEANT_NOT_AUTH               EQU     16
IEANT_SRB_MODE               EQU     20
IEANT_LOCK_HELD              EQU     24
IEANT_LEVEL_INVALID          EQU     28
IEANT_NAME_INVALID           EQU     32
IEANT_PERSIST_INVALID        EQU     36
IEANT_AR_INVALID             EQU     40
IEANT_UNEXPECTED_ERR         EQU     64

To obtain the name of the logrec data set or the name of the logrec log stream, you can include the IFBNTASM macro, as well as the IEANTASM macro, in your program. See Example 2 for the list of definitions IFBNTASM provides.

Restrictions

  • Do not use the IEAN4RT callable service in a RESMGR resource manager routine unless one of the following is true:
    • The name/token pair is a system-level persistent name/token pair.
    • The resource manager is running for a daughter task of the task that owns the name/token pair.
    • The resource manager is running for the task that owns the name/token pair and that resource manager was established for a specific address space and a specific task.
  • Do not call the IEAN4RT callable service with user_name and user_token parameters being the same storage locations.

Input register information

Before issuing the IEAN4RT callable service, 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.

Output register information

When control returns to the caller, the general purpose registers (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 access registers (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 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.

Performance implications

None.

Syntax

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

Syntax Description
SYSSTATE AMODE64=YES  

CALL IEAN4RT

 
,(level
,user_name
,user_token
,return_code)
 

Link edit your program with a linkage-assist routine (also called a stub) in SYS1.CSSLIB unless you use one of the following techniques as an alternative to CALL IEAN4RT:
1.   LOAD EP=IEAN4RT
     Save the 8-byte entry point address with bit 63 changed to 0
     (...)
     Put the saved entry point address with bit 63 changed to 0 into 64-bit R15
     CALL (15),(...)

2.   LLGT  15,X'10'
     L     15,X'220'(15,0)
     L     15,X'14'(15,0)
     L     15,X'80'(15,0)
     CALL  (15),(...)

Both of these alternate techniques require verification that the IEAN4RT service is available (in the CVT, bit CVTZOS_V1R11 is on indicating that the program is running on z/OS V1R11 or a later release).

Parameters

The parameters are explained as follows:

level
Specifies a fullword that contains an integer indicating the level of the name/token pair from which you want to retrieve the token:
1
Task
2
Home address space
3
Primary address space
4
System
11
Task with authorization check
12
Home address space with authorization check
13
Primary address space with authorization check.
Note: Levels 11, 12, and 13 indicate that the IEAN4RT callable service should determine if the name/token pair being retrieved was created by an authorized program.
,user_name
Specifies the 16-byte area containing the name of the requested name/token pair.
,user_token
Specifies the 16-byte area to contain the token of the requested name/token pair.
,return_code
Specifies a fullword to contain the return code from the IEAN4RT service.

ABEND codes

None.

Return codes

When IEAN4RT returns control to your program, GPR 15 and return_code contain a return code. The following table identifies return codes in hexadecimal, tells what each means, and recommends as action that you need to take.

Table 1. Return Codes for the IEAN4RT Macro
Hexadecimal Return Code Meaning and Action
00 Meaning: The operation was successful.

Action: None.

04 Meaning: The request is rejected because the system could not find the requested name/token pair.

Action: Check the user_name you specified.

08 Meaning: The request is rejected because the caller is in 24-bit addressing mode.

Action: Change your program to 64-bit addressing mode.

10 Meaning: A request for a retrieval with authorization check attempted to retrieve a name/token pair created by an unauthorized caller.

Action: If your program is authorized, you need to make sure that the name/token pair you are retrieving was created by another authorized program. You may choose to use the name/token pair if it was created by an unauthorized program, but doing so might cause data integrity problems.

14 Meaning: An SRB-mode caller attempted to retrieve a task-level name/token pair.

Action: Check which level of name/token pair you are retrieving.

1C Meaning: The caller specified an incorrect level.

Action: Respecify the correct level. Valid options are 1, 2, 3, 4, 11, 12, or 13.

40 Meaning: A system error occurred while handling the request.

Action: Retry the request.