DB2 Stored Proc from CICS-How?

Yes, we can access Db2 stored proc from CICS.

CICS transaction manager comes with DB2 attachment facility.This is the reason CICS can access DB2 stored procedure from CICS.

Every CICS region can access only one DB2 sub-system.

  • Stored procedures are accessed from CICS programs by issuing SQL CALL statements
  • A CALL statement that references a stored procedure must be bracketed between EXEC SQL and the statement terminator appropriate for the host language
  • For COBOL programs, the statement terminator is END-EXEC

An example:

EXEC SQL
     CALL EMPRSETC(

                    :PDEPTNO
                   ,:PDEPTNAME
                   ,:PSQLCODE
                   ,:PSQLSTATE
                   ,:PSQLERRMC
                  )
END-EXEC.

Note:The CICS application program must include logic to set the host variables prior to executing the CALL, and must include logic to handle any error conditions returned by the stored procedure. These two logic components are no different than what is required of a batch program written in the same host language.

Refer more in the link from IBM.

About these ads

6 thoughts on “DB2 Stored Proc from CICS-How?

  1. Pingback: DB2 Connect-Interfacing with distriuted systems | Mainframe-Srini Blogs

  2. Pingback: Setup WLM for DB2 Stored Proc | Mainframe-Srini Blogs

  3. Pingback: How to Access DB2 Stored Proc from IMS? | Mainframe-Srini Blogs

  4. Pingback: VaGen & Cool:Gen – Difference | Mainframe-Srini Blogs

Comments are closed.