DB2 stored procedure from IMS program Logic to read today

Posted by

This is now the capability of Zo/s. IMS batch come with a DB2 attachment facility.
Each IMS TM or batch region can be connected to only one DB2 subsystem at a time.

Steps required:

  • If you want to access DB2 stored proc from IMS.You need to do DB2 pre-compile and Bind the program.
  • The below stored procedure we can access it from IMS program

EXEC SQL CALL EMPRSETC(   :PDEPTNO ,:PDEPTNAME ,:PSQLCODE ,:PSQLSTATE ,:PSQLERRMC )
END-EXEC.

IMS 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.