INQY call
The Inquiry (INQY) call is used to request information regarding execution environment, destination type and status, and session status. INQY is valid only for application interfaces that use the AIB structure.
Format
Call Name | DB/DC | DBCTL | DCCTL | DB Batch | TM Batch |
---|---|---|---|---|---|
INQY | X | X | X | X | X |
Parameters
- aib
- Specifies the address of the application interface block (DFSAIB) for the call. This parameter
is an input and output parameter. These fields must be initialized in the AIB:
- AIBID
- Eye catcher. This 8-byte field must contain DFSAIBbb.
- AIBLEN
- AIB lengths. This field must contain the actual length of the AIB that the application program obtained.
- AIBSFUNC
- Subfunction code. This field must contain one of the 8-byte subfunction codes as follows:
- bbbbbbbb (Null)
- DBQUERYb
- ENVIRONb
- ENVIRON2
- FINDbbbb
- LERUNOPT
- MSGINFOb
- PROGRAMb (Not supported with the ODBA interface)
- AIBRSNM1
- Resource name. This 8-byte, left-aligned field must contain the name of any named PCB in the PSB.
- AIBOALEN
- I/O area length. This field must contain the length of the I/O area specified in the call list. This field is not changed by IMS.
- i/o area
- Specifies the data output area to use with the call. This parameter is an output parameter. An I/O area is required for INQY subfunctions ENVIRONb, ENVIRON2, MSGINFOb and PROGRAMb. It is not required for subfunctions DBQUERYb, FINDbbbb, and LERUNOPT.
Restrictions
A CPI Communications driven application program cannot issue an INQY call with the null subfunction against an I/O PCB.
A batch program cannot issue an INQY call with a null subfunction.
Usage
The INQY call operates in both batch and online IMS environments. IMS application programs can use the INQY call to request information about the output destination, the session status, the current execution environment, the availability of databases, and the PCB address, which is based on the PCB name. You must use the AIB when issuing an INQY call. Before you can issue an INQY call, initialize the fields of the AIB.
When you use the INQY call, specify an 8-byte subfunction code, which is passed in the AIB. The INQY subfunction determines the information that the application program receives.
The INQY call returns information to the caller's I/O area. The length of the data that is returned from the INQY call is passed back to the application program in the AIB field, AIBOAUSE.
Specify the size of the I/O area in the AIB field, AIBOALEN. The INQY call returns only as much data as the area can hold in one call. If the area is not large enough for all the information, an AG status code is returned, and partial data is returned in the I/O area. In this case, the AIB field AIBOALEN contains the actual length of the data that is returned to the I/O area, and the AIBOAUSE field contains the output area length that would be required to receive all the data.
Querying information from the PCB: INQY null
When the INQY call is issued with the null subfunction, the application program obtains information related to the PCB, including output destination type and location, and session status. The INQY call can use the I/O PCB or the alternate PCB. The information you receive regarding destination location and session status is based on the destination type. The destination types are APPC, OTMA, TERMINAL, TRANSACT, and UNKNOWN.
Related reading: For more information about APPC and LU 6.2, see IMS Version 15.4 Communications and Connections.
The INQY null subfunction returns character string data in the I/O area. The output that is returned for the destination types APPC, OTMA, TERMINAL, and TRANSACT is left justified and padded with blanks. The UNKNOWN destination type does not return any information. The following tables list the output returned from the INQY null call. Refer to the notes associated with the table for further information about some of the entries.
Information returned | Length in bytes | Actual value | Explanation |
---|---|---|---|
Destination Type | 8 | Terminal | The destination of the I/O PCB or alternate PCB is a terminal. |
Terminal Location | 8 | Local | The terminal is defined as local. |
Remote | The terminal is defined as remote. | ||
Queue Status | 8 | Started | The queue is started and can accept work. |
Stopped | The queue is stopped and cannot accept work. | ||
Session Status | 8 | b | The status is not available. |
ACTIVE | The session is active. | ||
INACTIVE | The session is inactive. |
Information returned | Length in bytes | Actual value | Explanation |
---|---|---|---|
Destination Type | 8 | TRANSACT | The destination of the alternate PCB is a program. |
Transaction Location | 8 | Local | The transaction is defined as local. |
Remote | The transaction is defined as remote. | ||
DYNAMIC | The transaction is defined as dynamic.1 | ||
Transaction Status | 8 | STARTED | The transaction can be scheduled.2 |
STOPPED | The transaction cannot be scheduled.2 | ||
Destination PSB Name | 8 | This field gives the name of the destination PSB. | |
b | The Program Routing exit routine has defined the destination as a transaction not on this system or the transaction is dynamic. The transaction destination is not available. | ||
Destination Program or Session Status | 8 | b | The status is not available. |
ACTIVE | The MSC link session is active (remote transaction or a transaction that was rerouted to a remote IMS by the TM and Message Routing and Control user exit routine (DFSMSCE0)). | ||
INACTIVE | The MSC link session is inactive (remote transaction or a transaction that was rerouted to a remote IMS by the TM and Message Routing and Control user exit routine (DFSMSCE0)). | ||
STARTED | The program can be scheduled (local transaction). | ||
STOPPED | The program cannot be scheduled (local transaction). | ||
Notes:
|
Information returned | Length in bytes | Actual value | Explanation |
---|---|---|---|
Destination Type | 8 | APPC | The destination is an LU 6.2 device. |
APPC/MVS Side Information Entry Name1 | 8 | This field provides the Side Name. | |
b | The Side Name is not available. | ||
Partner Logical Unit Name2 | 8 | This field provides the partner LU name for the conversation. | |
b | The partner LU name is not available. | ||
Partner Mode Table Entry Name3 | 8 | This field provides the Mode Name for the conversation. | |
b | The Mode Name is not available. | ||
User Identifier | 8 | This field provides the user ID. | |
b | The user ID is not available. | ||
Group Name | 8 | This field provides the Group Name. | |
b | The Group Name is not available. | ||
Synchronization Level4 | 1 | C | The synchronization level is defined as CONFIRM. |
N | The synchronization level is defined as NONE. | ||
Conversation Type5 | 1 | B | The conversation is defined as BASIC. |
M | The conversation is defined as MAPPED. | ||
Userid Indicator | 1 | The value of the Userid Indicator field indicates the contents of the user ID field. The Userid Indicator field has four possible values. | |
U | The U value indicates the user's identification from the source terminal during signon. | ||
L | The L value indicates the LTERM name of the source terminal if signon is not active. | ||
P | The P value indicates the PSBNAME of the source BMP or transaction. | ||
O | The O value indicates some other name. | ||
Address of TPN6 | 4 | This is the address of the LL field of the Transaction Program Name. 7 | |
0 | The address of the Transaction Program Name is not available. | ||
Notes:
|
Information Returned | Length in Bytes | Actual Value | Explanation |
---|---|---|---|
Destination Type | 8 | OTMA | The destination is an OTMA client. |
tpipe Name | 8 | This field provides the OTMA transaction pipe name. | |
b | The tpipe Name is not available. | ||
Member Name | 16 | This field provides the z/OS® cross-system coupling facility (XCF) member name of the OTMA client. | |
b | The Member Name is not available. | ||
User Identifier | 8 | This field provides the User ID. | |
b | The User ID is not available. | ||
Group Name | 8 | This field provides the group name. | |
b | The Group Name is not available. | ||
Synchronization Level | 1 | S | The OTMA transaction pipe is synchronized. |
b | The OTMA transaction pipe is not synchronized. | ||
Message Synchronization Level1 | 1 | C | The synchronization level is defined as CONFIRM. |
N | The synchronization level is defined as NONE. | ||
Userid Indicator | 1 | The value of the Userid Indicator field indicates the contents of the user ID field. The Userid Indicator field has four possible values. | |
U | The U value indicates the user's identification from the source terminal during signon. | ||
L | The L value indicates the LTERM name of the source terminal if signon is not active. | ||
P | The P value indicates the PSBNAME of the source BMP or transaction. | ||
O | The O value indicates some other name. | ||
Reserved for IMS | 1 | This field is reserved. | |
Notes:
|
Information returned | Length in bytes | Actual value | Explanation |
---|---|---|---|
Destination Type | 8 | UNKNOWN | Unable to find destination. |
The contents of the output fields vary depending on the
type of PCB used for the INQY
call. The following
table shows how INQY output for APPC destinations varies depending
on the PCB type. The PCB can be a TP PCB or an alternate PCB.
Output field | TP PCB | Alternate PCB (Non-modifiable) | Alternate PCB (Modifiable) |
---|---|---|---|
Destination Type | APPC | APPC | APPC |
Side Name | blanks | Side Name if available or blanks | Side Name if supplied on previous CHNG call or blanks |
LU Name | Input LU Name | LU Name if available or blanks | LU Name if supplied on previous CHNG call or blanks |
Mode Name | blanks | Mode Name if available or blanks | Mode Name if supplied on previous CHNG call or blanks |
User Identifier | USERID if available or blanks | USERID if available or blanks | USERID if available or blanks |
Group Name | Group Name if available or blanks | Group Name if available or blanks | Group Name if available or blanks |
Sync Level | C or N | C or N | C or N |
Conversation Type | B or M | B or M | B or M |
Userid Indicator | U or L or P or O | U or L or P or O | U or L or P or O |
TPN Address | Address of the TPN character string | Address of the TPN character string or zero | Address of the TPN character string or zero |
TPN character string
Note: If your TPN name is DFSASYNC, the destination represents
an asynchronous conversation.
|
Inbound name of IMS Transaction that is executing. | Partner TPN, if available. If not available, address field is zero. | TP Name if it is supplied on the previous CHNG call. If not supplied, the address field is zero. |
Related reading: For more information on APPC and LU 6.2, see IMS Version 15.4 Communications and Connections.
Querying data availability: INQY DBQUERY
When the INQY call is issued with the DBQUERY subfunction, the application program obtains information about the data for each PCB. The only valid PCB name that can be passed in AIBRSNM1 is IOPCBbbb. The INQY DBQUERY call is similar to the INITDBQUERY call. The INQY DBQUERY call does not return information in the I/O area, but like the INIT DBQUERY call, it updates status codes in the database PCBs.
The application program is not made aware of the status of each PCB until an INQY FIND call is issued. To retrieve the status for a database, you must pass the DB PCB for that database in the INQY FIND call.
In addition to the INIT DBQUERY status codes, the INQY DBQUERY call returns these status codes in the I/O PCB:
- bb
- The call is successful and all databases are available.
- BJ
- None of the databases in the PSB are available, or no PCBs exist in the PSB. All database PCBs (excluding GSAM) contain an NA status code as the result of processing the INQY DBQUERY call.
- BK
- At least one of the databases in the PSB is not available, or availability is limited. At least one database PCB contains an NA or NU status code as the result of processing the INQY DBQUERY call. When CATALOG PCBs show NA, the status code is bb.
The INQY call returns the following status codes in each DB PCB:
- NA
- At least one of the databases that can be accessed by using this PCB is not available. A call
that is made using this PCB probably results in a BA or BB status code if the INIT STATUS GROUPA
call has been issued, or in a DFS3303I message and 3303 pseudoabend if the call has not been issued.
An exception is when the database is not available because dynamic allocation failed. In this case,
a call results in an AI (unable to open) status code.
In a DCCTL environment, the status code is always NA.
- NU
- At least one of the databases that can be updated using this PCB is unavailable for update. An ISRT, DLET, or REPL call using this PCB might result in a BA status code if the INIT STATUS GROUPA call has been issued, or in a DFS3303I message and 3303 pseudoabend if it has not been issued. The database that caused the NU status code might be required only for delete processing. In that case, DLET calls fail, but ISRT and REPL calls succeed.
- bb
- The data that can be accessed with this PCB can be used for all functions the PCB allows. DEDBs and MSDBs always have the bb.
Querying the environment: INQY ENVIRON or ENVIRON2
When the INQY call is issued with the ENVIRON or ENVIRON2 subfunctions, the application program obtains information about the current execution environment. Both subfunctions cannot be used with the same INQY call, so use either ENVIRON or ENVIRON2. The ENVIRON subfunction provides compatibility for existing programs that require its specific use, whereas ENVIRON2 is newer and provides more information. The only valid PCB name that can be passed in AIBRSNM1 is IOPCBbbb. This includes the IMS identifier, release, region, and region type.
The INQY ENVIRON and ENVIRON2 calls return character-string data. The output is left-aligned and padded with blanks on the right.
To reference the field that contains the recovery token or the application parameter string, code your application programs to locate the field by using the address of the field that is returned in the data output of the INQY ENVIRON or INQY ENVIRON2 calls. This is the only valid programming technique to reference the recovery token field and the application parameter string field. No other programming technique should be used to reference these fields.
The recovery token or the application parameter string are optional and therefore are not always returned. If they are not returned, the value in the address field is zero.
The following table describes the INQY ENVIRON output.
Information returned | Length in bytes | Actual value | Explanation |
---|---|---|---|
IMS Identifier | 8 | Provides the identifier from the execution parameters. | |
IMS Release Level | 4 | Provides the release level for IMS. For example, X'00000410'. | |
IMS Control Region Type | 8 | BATCH | Indicates that an IMS batch region is active. |
DB | Indicates that only the IMS Database Manager is active. (DBCTL system) | ||
TM | Indicates that only the IMS Transaction Manager is active. (DCCTL system) | ||
DB/DC | Indicates that both the IMS Database and Transaction managers are active. (DB/DC system) | ||
IMS Application Region Type | 8 | BATCH | Indicates that the IMS Batch region is active. |
BMP | Indicates that the Batch Message Processing region is active. | ||
DRA | Indicates that the Database Resource Adapter Thread region is active. | ||
IFP | Indicates that the IMS Fast Path region is active. | ||
JBP | Indicates that the Java™ batch processing region is active. | ||
JMP | Indicates that the Java message processing region is active. | ||
MPP | Indicates that the Message Processing region is active. | ||
Region Identifier | 4 | Provides the region identifier. For example, X'00000001'. | |
Application Program Name | 8 | Provides the name of the application program being run. | |
PSB Name (currently allocated) | 8 | Provides the name of the PSB currently allocated. | |
Transaction Name | 8 | Provides the name of the transaction. | |
b | Indicates that no associated transaction exists. | ||
User Identifier1 | 8 | Provides the user ID. | |
b | Indicates that the user ID is unavailable. | ||
Group Name | 8 | Provides the group name. | |
b | Indicates that the group name is unavailable. | ||
Status Group Indicator | 4 | A | Indicates an INIT STATUS GROUPA call is issued. |
B | Indicates an INIT STATUS GROUPB call is issued. | ||
b | Indicates that a status group is not initialized. | ||
Address of Recovery Token2 | 4 | Provides the address of the LL field, followed by the recovery token. | |
0 | Indicates that the recovery token is not available. | ||
Address of the Application Parameter String2 | 4 | Provides the address of the LL field, followed by the application program parameter string. | |
0 | Indicates that the APARM= parameter is not coded in the execution parameters of the dependent region JCL. | ||
Shared Queues Indicator | 4 | Indicates that IMS is not using Shared Queues. | |
SHRQ | Indicates IMS is using Shared Queues. | ||
User ID of Address Space | 8 | User ID of dependent address space. | |
User ID Indicator | 1 | Contains one of the following possible values to indicate the contents of the
userid field:
|
|
z/OS Resource Recovery Services (RRS) Indicator | 3 | b | Indicates that IMS has not expressed interest in the UR with RRS. Therefore, the application should refrain from performing any work that causes RRS to become the syncpoint manager for the UR because IMS will not be involved in the commit scope. For example, the application should not issue any outbound protected conversations. |
RRS | Indicates that IMS has expressed interest in the UR with RRS. Therefore, IMS is involved in the commit scope if RRS is the syncpoint manager for the UR. | ||
IMS catalog enablement indicator | 8 | b | Indicates that the IMS catalog is not enabled in the DFSDFxxx PROCLIB
member. For information about setting up and enabling an IMS catalog, see IMS catalog definition and tailoring. For information about enabling the IMS catalog in the DFSDFxxx PROCLIB member, see DFSDFxxx member of the IMS PROCLIB data set. |
CATALOG plus one byte of reserved space initialized as a blank. | Indicates that the IMS catalog is enabled. Database and application metadata are available in IMS. Data mask definitions that use this value must include all eight bytes. | ||
Notes:
|
The INQY ENVIRON2 subfunction returns all the information provided by the ENVIRON subfunction, plus the output described in the following table.
Information returned | Length in bytes | Actual value | Explanation |
---|---|---|---|
INQY ENVIRON2 output version | 4 | Indicates the version number of this INQY ENVIRON2 output. | |
IMS installed version (Entries in this row's Actual value column show actual values for IMS versions 15.1, 15.2, and 15.3. A similar output pattern applies for newer versions of IMS.) |
4 | X'00001510' | Indicates IMS version 15.1.0 |
X'00001520' | Indicates IMS version 15.2.0 | ||
X'00001530' | Indicates IMS version 15.3.0 | ||
IMS function level | 4 | Indicates the currently installed function level of IMS. | |
Functions enabled bitmap | 32 | Is the value of the IMS functions enabled bitmap. | |
Primary Language Environment enclave addressing mode | 2 | 31 | Indicates that the primary Language Environment enclave addressing mode is 31-bit. |
64 | Indicates that the primary Language Environment enclave addressing mode is 64-bit. | ||
0 | Indicates that no JVM was requested. | ||
Language Environment enclave addressing mode for JVM | 2 | 31 | Indicates that the Language Environment enclave addressing mode of the requested JVM is 31-bit. |
64 | Indicates that the Language Environment enclave addressing mode of the requested JVM is 64-bit. | ||
0 | Indicates that no JVM was requested. | ||
IMS MACB enablement indicator | 4 | No value | Indicates that managed ACBs is disabled. |
MACB | Indicates that managed ACBs is enabled. | ||
Notes:
|
Querying the input message information: INQY MSGINFO
To obtain information regarding the current input message, use the INQY call with the MSGINFO subfunction. The only valid PCB name that can be passed in the AIBRSNM1 field is IOPCBbbb. The output returns the version number and the output fields for the message information. The INQY MSGINFO call returns the response in the I/O area.
The following table lists the output that is returned from the INQY MSGINFO call. Included with the information returned is the byte length, the actual value, and an explanation of the output.
The distributed network user ID, if used, has a variable length from 1 to 246 bytes and the distributed network session ID, if used, has a variable length from 1 to 254 bytes. Because the size of the distributed network security credentials can vary, the information is appended to the end of the response in the I/O area. If network security credentials are included in the message, define the I/O area, in the AIB field AIBOALEN, with the appropriate 2-byte length to account for the variable length of the network user ID and the network session ID.
To reference the field that contains the distributed network user ID or distributed network session ID, code your application programs to locate the field by using the address of the field that is returned in the data output of the INQY MSGINFO call. The address identifies a length field (LL) that contains the length of the ID followed by the distributed network user ID or network session ID. This is the only valid programming technique to reference the network user ID and network session ID.
The distributed network user ID or network session ID are optional and therefore are not always returned. If they are not returned, the value in the address field is zero.
Information returned | Length in bytes | Actual value | Explanation |
---|---|---|---|
Version number | 4 | 1, 2, or 3 |
Output response version 1 contains the origin IMS ID. Output response version 2 contains both the origin IMS ID and the distributed network security credentials. Output response version 3 contains the transaction orchestration information with the additional OTMA info, TRANCODE, USERID, TPIPE name, and TMEMBER name. |
Origin IMSID | 8 | The IMS identifier from which the input message originated. | |
Address of distributed network user ID | 4 | If this field is zero, network user ID is not available. If this field is nonzero, it provides the address of the LL field followed by the network user ID for the input message. | |
Address of distributed network session ID | 4 | If this field is zero, network session ID is not available. If this field is non-zero, it provides the address of the LL field followed by the network session ID for the input message. | |
OTMA info | 4 | 0, 1, or 2 | 0- Default, 1- OTMA TRANORCH input, 2- TRANORCH response with correlator token |
TRANCODE | 8 | Transaction code information | |
USERID | 8 | User ID information | |
TPIPE name | 8 | Client's TPIPE name. If the OTMA info value is 2, it shows the TPIPE name from the TRANORCH input message. | |
TMEMBER name | 16 | Client's TMEMBER name. If the OTMA info value is 2, it shows the TMEMBER or DATASTORE name from the TRANORCH input message. | |
Reserved for IMS | 16 | This field is reserved for future output expansion. |
Information returned | Length in bytes | Actual value | Explanation |
---|---|---|---|
Version number | 4 | 1 or 2 |
Output response version 1 contains the origin IMS ID. Output response version 2 contains both the origin IMS ID and the distributed network security credentials. |
Origin IMSID | 8 | The IMS identifier from which the input message originated. | |
Address of distributed network user ID | 4 | If this field is zero, network user ID is not available. If this field is nonzero, it provides the address of the LL field followed by the network user ID for the input message. | |
Address of distributed network session ID | 4 | If this field is zero, network session ID is not available. If this field is non-zero, it provides the address of the LL field followed by the network session ID for the input message. | |
Reserved for IMS | 60 | This field is reserved for future output expansion. |
Querying the PCB address: INQY FIND
When
the INQY
call is issued with the FIND subfunction,
the application program is returned with the PCB address of the requested
PCB name. The valid PCB names that can be passed in AIBRSNM1 are
IOPCBbbb or the name of the alternate PCB (TP PCB) or database PCB
as it is defined in the PSB.
On a FIND subfunction, the requested PCB remains unmodified, and no information is returned in an I/O area.
The
FIND subfunction is used to get a PCB address following an INQY
DBQUERY
call. This process allows the application to analyze
the PCB status code to determine if an NA or NU status code is set
in the PCB.
Querying for LE overrides: INQY LERUNOPT
When the LERUNOPT
call is issued with the LERUNOPT subfunction, IMS determines whether LE overrides are allowed based on the LEOPT system
parameter. The LE override parameters are defined to IMS
through the UPDATE LE
command. IMS checks to
see whether there are any overrides applicable to the caller based on the specific combinations of
transaction name, lterm name, userid, or program name in the callers environment. IMS returns the address of the string to the caller if an override parameter is
found. The LE overrides are used by the IMS supplied CEEBXITA
exit, DFSBXITA, to allow dynamic overrides for LE runtime parameters.
The call string must contain the function code and the AIB address. The I/O area is not a required parameter and is ignored if specified. The only valid PCB name that can be passed in AIBRSNM1 is IOPCB. The AIBOALEN and AIBOAUSE fields are not used.
The rules for matching an entry that results in it being returned on a DL/I INQY LERUNOPT call are:
- An MPP or JMP region uses transaction name, lterm, userid, and program to match with each entry.
- An IFB, JBP, or non-message-driven BMP uses program name to match with each entry. If an entry has a defined filter for transaction name, lterm, or userid, it does not match. Message driven BMPs also use transaction name.
- The entries are scanned to find the entry with the most filter matches. The first entry in the
list with the most exact filter matches is selected. The scan stops with an entry found with all of
the filters matching the entry. Note: Searching table entries may cause user confusion because of the way entries are built and searched. For example, assume that there are two entries in the table that match on the filters specified on the DL/I INQY call. The first transaction matches on transaction name and lterm name. The second entry matches on transaction name and program name. IMS chooses the first entry because it was the first entry encountered with highest number of filter matches. If the second entry is now updated with a longer parameter string, which causes a new entry to be built, it is added to the head of the queue. The next search would result in the entry with transaction name and program name being selected. This could result in a set of runtime options being selected that were not expected by the user.
Environments: The LERUNOPT subfunction can be specified from DB/DC, DBCTL, and DCCTL environments. Overrides are based on a combination of transaction name, lterm name, user ID, and program name in MPP and JMP regions. IFP, BMP, and JBP regions will have overrides based on program name. Message driven BMP regions can also use transaction name.
Return and reason codes: AIB return and reason codes must be checked to determine if the call has been successfully completed. AIBRSA2 is used to return the address of the parameter string if override parameters are available for the caller.
Querying the program name: INQY PROGRAM
When you issue the INQY call with the PROGRAM subfunction, the application program name is returned in the first 8 bytes of the I/O area. The only valid PCB name that can be passed in AIBRSNM1 is IOPCBbbb.
INQY return codes and reason codes
When you issue the INQY call, return and reason codes are returned to the AIB. Status codes can be returned to the PCB. If return and reason codes other than those that apply to INQY are returned, your application should examine the PCB to see what status codes are found.
Map of INQY subfunction to PCB type
Subfunction | I/O PCB | Alternate PCB | DB PCB | I/O Area Required |
---|---|---|---|---|
FIND | OK | OK | OK | NO |
ENVIRON or ENVIRON2 | OK | NO | NO | YES |
DBQUERY | OK | NO | NO | NO |
LERUNOPT | OK | NO | NO | NO |
PROGRAM | OK | NO | NO | YES |
MSGINFO | OK | NO | NO | YES |