Queries

The predefined queries that are supplied with the CICS® IA® plug-in, any queries that you created and saved, and any query results that you saved are displayed when you expand Queries in the IA Navigation view. You can create, edit, or run a query, and organize queries and their results into folders and subfolders.

When you create a query, you can query any resources in any combination. You can add filters to the query to refine the results, and you can define the structure of the results that are displayed in the Resources view. You can modify existing queries, whether they are supplied predefined queries or queries that you created.

When you run a query, you can save the search results in a list under the query name for future reference. Queries are saved to your workspace, which is defined when you install the product. You can modify the workspace location at any time when you run CICS Explorer®.

Before you create a query, click the name of the folder where you want to save the new query. You cannot move a query after it is saved.

To create a new folder, click the name of the parent folder for the new folder. Then, either click File > New > Folder in the toolbar menu, or right-click then click New > Folder. A new folder is created with the name New folder. To rename the folder, type over this name (see Naming a folder or query).

Screen capture of expanded Queries and the menu
To create a query, either click File > New in the toolbar menu, or right-click any of the entities in the view then click New. Then, click one of the following options, depending on the type of query that you want to create:
  • CICS query
  • Scanner query
  • Affinity query
  • IMS query
  • DB2 query
  • MQ query
  • Command Flow query
  • Natural query
A Create query window is displayed. You can enter a name for the query and enter the resources or columns that you want to show and the interactions that you want to include. For more information, see Query editor.

To copy the definition of a query to the clipboard, select the query, right-click, then click Copy. You can then paste the definition into the same folder, or a different folder, in Queries. You can also paste the query definition into a text editor and view the SQL strings that are run against the database tables. This feature is useful if you want to use your own methods to run SQL and collect results.

To run a query, select the query, right-click, then click Run. The results of the query are shown in the Show Resources view. The name of the query is displayed in the toolbar of the view. If a CICS query includes the Collection ID and a specific collection ID is set as the current scope, this scope is also displayed in the toolbar.

Screen capture of the Show Resources view that shows the results of running a query.

To save the query results and list them under the query name, click File > Save in the toolbar menu. The Save query results window is displayed, where you can enter a suitable description for the results. Ensure that you use valid characters (see Naming a folder or query).

In the following example, the query results are named Before Fix 123456 applied.

Screen capture of the Save query results window.

The query results description, together with the date and time that the query ran, is listed as a child of the query when you expand Queries. In the following example, the data for the query result Before Fix 123456 applied is listed as a child of the All transactions by region query.

Screen capture of Queries that shows a query result, as described in the accompanying text.

To copy a set of query results to the clipboard, right-click the required results, then click Copy. You can then paste the data into a spreadsheet or other tools for analysis.

To open a set of query results and view the data that was saved in the Show Resources view, right-click the required results, then click Run.

You can run the same query on different dates and save the results. Then, you can compare the different query results to see what the changes are and build up a picture of change over time. For more information, see Comparing resources.

You can delete individual query results. If you delete a query, all of its query results are also deleted.

Naming a folder or query

Ensure that you use characters for the name of a query or a folder that are valid for your operating system. For example, in the Windows operating system, you cannot use the following characters for the name of a query or a folder:
: ; / \ [ ] = * . | ?
Failure to use valid characters might cause unpredictable behavior; for example, the inability to view a saved query. To ensure predictable behavior, it is advisable to use only alphanumeric characters.