With the help of this CICS® IA External Interface, you can access saved dependency data directly from your application.
CIUSPAPP is a DB2® Stored Procedure that acts as dependency data query interface. It can be called from a user application with the SQL CALL statement to get the collected dependency data from CICS IA interdependency database.
EXEC SQL
CALL CIUSPAPP (calltype, appcode, restype, error-message, return-code);
There are several input parameters that assist you to manage CIUSPAPP processing and several output parameters that inform about the process completion and errors, if any.
Parameter name | input/output | Type | Description |
---|---|---|---|
calltype | INPUT | CHAR(4) | Type of call |
appcode | INPUT | CHAR(8) | Application code |
restype | INPUT | CHAR(8) | Resource type |
error-message | OUTPUT | CHAR(300) | Error message text |
return-code | OUTPUT | INTEGER | Return code |
calltype value | Description |
---|---|
LIST | Calls for a list of the applications that are defined in CICS IA. Fetches information from the CIU_APPLS_DESC table (APPLIC_CODE and APPLIC_NAME). |
CICS | Calls for a list of CICS resources. Fetches information from the CIU_CICS_DATA table (TYPE and OBJECT). |
DB2 | Calls for a list of DB2 resources. Fetches information from the CIU_DB2_DATA table (restypeand resname). |
MQ | Calls for a list of MQ resources. Fetches information from the CIU_MQ_DATA table (TYPE and OBJECT). |
IMS™ | Calls for a list of IMS resources. Fetches information from the CIU_IMS_DATA table (TYPE and OBJECT). |
DEFN | Calls for a list of all transactions/programs. Fetches information from the CIU_APPLS_RESOURCE table (APPLIC_CODE, APPLIC_TYPE, and APPLIC_RESNAME). |
RES | Calls for a list of CICS, DB2, IMS, and MQ resources for the defined appcode and restype parameters. |
The appcode parameter specifies the Application Code. Required for calltype values CICS, DB2, MQ, IMS, DEFN, RES.
The restype parameter specifies the resource type. Required for the calltype value DEFN and has itself three values: PROGRAM, TRANSID, or null.
Return code | Description |
---|---|
0 | CIUSPAPP procedure that completed successfully. |
4 | One of the following conditions exists: either the calltype value is invalid, or an SQL exception/warning occurred during the CIUSPAPP run time. |
5 | The appcode value is not specified. |
calltype = 'LIST'
The
other input parameters are ignored and can be set to null values.
This call returns one result set with APPLIC_CODE and APPLIC_NAME columns from CIU_APPLS_DESC table.
calltype = 'CICS'
appcode = application code
The restype input
parameter is ignored and can be set to null value. This call returns one result set with TYPE and OBJECT columns from the CIU_CICS_DATA table.
calltype = 'DB2'
appcode = application code
The restype input
parameter is ignored and can be set to null value. This call returns one result set with restype and resname columns from the CIU_DB2_DATA table.
calltype = 'MQ'
appcode = application code
The restype input
parameter is ignored and can be set to null value. This call returns one result set with TYPE and OBJECT columns from the CIU_MQ_DATA table.
calltype = 'IMS'
appcode = application code
The restype input
parameter is ignored and can be set to null value. This call returns one result set with TYPE and OBJECT columns from the CIU_IMS_DATA table
calltype = 'DEFN'
appcode = application code
restype = resource type
The restype input
parameter must be set to either PROGRAM to list all application programs
or to TRANSID to list all application transactions. To list both application
programs and transactions, it must be set to null value. This call returns one result set with APPLIC_CODE, APPLIC_TYPE and APPLIC_RESNAME columns from the CIU_APPLS_RESOURCE table.
calltype = 'RES'
appcode = application code
The restype input
parameter is ignored and can be set to null value. This call returns four result sets which returned separately for CICS, DB2, MQ, and IMS call types.
IDENTIFICATION DIVISION.
PROGRAM-ID. CALLSPM.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
DATA DIVISION.
FILE SECTION.
WORKING-STORAGE SECTION.
*****************************************************
* WORKAREAS *
*****************************************************
01 WV-APPLIC-NAME PIC X(50).
01 WV-APPLIC-CODE PIC X(08).
01 WW-CALLTYPE PIC X(4).
01 WW-APPLIC-CODE PIC X(08).
01 WW-APPLIC-TYPE PIC X(08).
01 WW-ERRMSG PIC X(300).
01 WW-RC PIC S9(8) BINARY.
****************************************************************
* A RESULT SET LOCATOR FOR THE RESULT SET THAT IS RETURNED. *
****************************************************************
01 LOC-DTLSC USAGE SQL TYPE IS
RESULT-SET-LOCATOR VARYING.
PROCEDURE DIVISION.
*------------------
MAINLINE.
MOVE 'LIST' TO WW-CALLTYPE.
MOVE ' ' TO WW-APPLIC-CODE.
MOVE ' ' TO WW-APPLIC-TYPE.
EXEC SQL
CALL CIUSPAPP(:WW-CALLTYPE,
:WW-APPLIC-CODE, :WW-APPLIC-TYPE,
:WW-ERRMSG, :WW-RC)
END-EXEC.
EXEC SQL ASSOCIATE LOCATORS (:LOC-DTLSC)
WITH PROCEDURE CIUSPAPP
END-EXEC.
EXEC SQL ALLOCATE C1 CURSOR FOR RESULT SET :LOC-DTLSC
END-EXEC.
EXEC SQL FETCH C1
INTO :WV-APPLIC-CODE, :WV-APPLIC-NAME
END-EXEC.
DISPLAY 'CODE= ' WV-APPLIC-CODE
'NAME= ' WV-APPLIC-NAME
GOBACK.