QUERY
Retrieve information about a result set and the resource table records it contains.
Description
This command retrieves information
about a result set and the resource table records it contains.
- You can use the QUERY command to determine:
- The context and scope of the result set
- The type of resource table records the result set contains
- Whether the records are from the CICSPlex® SM resource table or a user-defined view of that table
- The number of resource table records in the result set
- The length of the resource table records
- For programs written in REXX, issuing the QUERY command is the only way to determine the length of a given resource table record.
Related commands
COPY, GET, GETDEF, GROUP, PERFORM OBJECT
Options
- CONTEXT(data-ref)
- Names a variable to receive the context associated with the result set.
- COUNT(data-ref)
- Names a variable to receive the number of resource table records in the result set.
- DATALENGTH(data-ref)
- Names a variable to receive the length of the resource table records in the result set.
- OBJECT(data-ref)
- Names a variable to receive the name of the resource table currently
associated with the result set.Note: If QUERYERROR is specified, the OBJECT returned is MASQRYER, not the object or view contained in the result set.
- QUERYERROR
- Indicates that this request is to return information on MASQRYER resources generated by the last GET, PERFORM, or SET command to act on the result set.
- REASON(data-ref)
- Names a variable to receive the fullword reason value returned by this command.
- RESPONSE(data-ref)
- Names a variable to receive the fullword response value returned by this command.
- RESULT(cpsm-token)
- Identifies the API result set to be processed by this operation.
The result set can be one produced by any of these commands:
- COPY
- GET
- GETDEF
- GROUP
- PERFORM OBJECT.
- SCOPE(data-ref)
- Names a variable to receive the scope associated with the result set. This value may be blank for result sets containing CMAS type resources.
- THREAD(cpsm-token)
- Identifies the API thread to be used for this operation. The cpsm-token value that identifies a thread is returned by the CONNECT command.
- TYPE(data-ref)
- Names a variable to receive a 1-character value that indicates
what type of records are in the result set:
- T
- Resource tables supplied by CICSPlex SM.
- V
- Views of a resource table created by a SPECIFY VIEW command issued previously on this processing thread.
Conditions
The following is a list of the
RESPONSE values that can be returned by the QUERY command. The description
of each RESPONSE includes a list of associated REASON values, if appropriate.
- OK
- The command completed processing successfully.
- BUSY
- A busy condition occurred for the following reason:
- RESULT
- The result set specified on the RESULT option is being processed by another command.
- ENVIRONERROR
- An environment error occurred for one of the following reasons:
- NOSERVICE
- The application stub program could not load the API service module.
- NOSTORAGE
- The application stub program could not obtain the necessary storage in the address space where the processing thread is running.
- SOCRESOURCE
- A required resource that is owned by the CMAS is not available.
- FAILED
- The command failed for one of the following reasons:
- ABENDED
- Command processing abended.
- EXCEPTION
- Command processing encountered an exceptional condition.
- INVALIDPARM
- An invalid parameter was detected. The parameter that is invalid
is returned as the reason value:
- CONTEXT
- DATALENGTH
- OBJECT
- RESULT
- THREAD
- TYPE.
- NODATA
- The command requested information about MASQRYER resources generated by the last command to process the result set, but the last command completed successfully, and there are no MASQRYER resources. If COUNT was requested a value of zero is returned.
- NOTAVAILABLE
- A not available condition occurred for one of the following reasons:
- APITASK
- The API control subtask is not active.
- CPSMAPI
- The CMAS to which the processing thread is connected is not available for API processing.
- SERVERGONE
- The CMAS to which the processing thread was connected is no longer active.
- VERSIONINVL
- A version conflict occurred for one of the following reasons:
- NOTSUPPORTED
- The version of the application stub program used for this command is not supported.
- NOTVSNCONN
- The version of the application stub program used for this command is not the same as the version used with the CONNECT command.
