CIUSPAP1 Stored Procedure

When you use the CIUSPAP1 stored procedure you can view or delete resource information for a CICS® TS application definition.

What is the CIUSPAP1 Stored Procedure?

Use the CIUSPAP1 is a DB2® Stored Procedure to carry out the following actions:
  • List CICS TS Applications for which you have collected data.
  • Retrieve or delete resources that are used by a specific TS application or operations that are associated with that application.

Syntax

You can invoke the CIUSPAP1 procedure with the following SQL CALL statement:
EXEC SQL 
CALL CIUSPAP1 (calltype, platform, appname, version1, version2, version3, operation, message, return-code); 

Procedure parameters

There are several input parameters that help you to manage CIUSPAP1 processing and several output parameters that inform about the process completion and errors, if any.

This table lists all CIUSPAP1 parameters.
Table 1. CIUSPAP1 parameters
Parameter name Input/Output Type Description
calltype INPUT CHAR(4) Type of call.
platform INPUT CHAR(64) Specifies the platform name (this parameter is used for all calltypes other than LIST).
appname INPUT CHAR(64) Specifies the application name (this parameter is used for all calltypes other than LIST).
version 1 INPUT INTEGER Specifies a Major Version of Application (this parameter is used for all calltypes other than LIST).
version 2 INPUT INTEGER Specifies a Minor Version of Application (this parameter is used for all calltypes other than LIST).
version 3 INPUT INTEGER Specifies a Micro Version of Application (this parameter is used for all calltypes other than LIST).
operation INPUT CHAR(64) Specifies the operation name (this parameter is optional and can be used for all calltypes other than LIST).
message OUTPUT CHAR(300) Specifies a message buffer that contains error information for a List call type, or the result of procedure execution for a Delete call type.
return-code OUTPUT INTEGER Return code.

CIUSPAP1 INPUT parameters (calltype, appname)

The calltype parameter specifies queries that can be called by the application. Table calltype values lists all available queries and their description.
Table 2. calltype values

calltype
value

Description
LIST List of Applications for which CICS IA has collected data.
DEL Deletes all resources that are associated with the Application.
RES Lists all resources that are associated with the Application.
CICS Lists all CICS resources that are associated with the Application.
DB2 Lists all DB2 resources that are associated with the Application.
IMS™ Lists all IMS resources that are associated with the Application.
MQ Lists all WebSphere® MQ resources that are associated with the Application.
NAT Lists all Natural resources that are associated with the Application.

CIUSPAP1 OUTPUT parameters (error-message, return-code)

The return-code parameter contains value of the CIUSPAP1 return code. Possible return-code values are listed in this table:
Table 3. return-code values
Return code Description
0 CIUSPAP1 procedure has completed successfully.
4 Any SQL Exception or SQL Warning occurred, in this case ERROR-MESSAGE contains the message with explanation of exception/warning.
8 One of the following conditions exists:
calltype
Is invalid, that is the value is not L/D, in this case ERROR-MESSAGE contains the following text: 'Invalid call type'
appname
Is invalid, that is the value is empty, in this case ERROR-MESSAGE contains the following text: ‘Application Name must be specified’
The error-message parameter contains message text that describes the error or warning:
  • For return-code=4, it provides either the relevant SQL warning, or the "Invalid call type" message, depending on the error cause.
  • For return-code=8, it provides the following message: "Application name must be specified".

Listing all CICS TS applications

To retrieve a list of all CICS TS Applications that you have collected data for, set the input parameters as follows:
CALLTYPE='LIST'

Set all other input parameters to null values.

This call returns one OPEN cursor which you use to FETCH the returned data by running an SQL ASSOCIATE LOCATORS, followed by an SQL ALLOCATE cursor, and then the SQL FETCH loop as shown in the COBOL example for CIUSPAPP Stored Procedure.

Resources used by applications

To retrieve a list of all resources used by a CICS TS Application, set the input parameters as follows:
  • calltype ='RES'
  • Set the applname and version fields as required.
To list the resources by the operation within an Application, set the Operation field to the name of the operation; otherwise, leave it blank.

This call returns one 5 OPEN cursor which you use to FETCH the returned data by running an SQL ASSOCIATE LOCATORS, followed by an SQL ALLOCATE cursor, and the SQL FETCH loop as shown in the COBOL example for CIUSPAPP Stored Procedure.