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 enable 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 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 (RESTYPE and 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 two values: PROGRAM and TRANSID.
Return code | Description |
---|---|
0 | CIUSPAPP procedure 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. |
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.