Calling user programs from VISION:Builder to perform DB2 SQL Commands
search cancel

Calling user programs from VISION:Builder to perform DB2 SQL Commands

book

Article ID: 31051

calendar_today

Updated On:

Products

Vision:Builder

Issue/Introduction

There are two cases to consider when a subprogram is invoked by VISION:Builder to perform DB2 commands. 

Resolution

Case 1 - VISION:Builder application IS NOT using DB2 Files (M4OLD, M4CORDn, M4SUBFn). 

The user program that is Called from VISION:Builder would need to do the CONNECT, OPEN/CLOSE Plan, and DISCONNECT along with any other SQL Commands.  VISION:Builder does not do any SQL Commands when there are no DB2 Files in the application.

 

Case 2 - VISION:Builder application IS using DB2 Files (M4OLD, M4CORDn, M4SUBFn).

Since VISION:Builder is using DB2 Files and SQL Commands, VISION:Builder will do the CONNECT, OPEN/CLOSE Plan, and DISCONNECT when using CALL Attach. With TSO and IMS Attach, the connection work is done by TSO or IMS control programs.

The user program that is Called from VISION:Builder cannot use any SQL Attach Commands (CONNECT, OPEN, CLOSE, DISCONNECT).  The user program can use the other SQL Commands as needed.

You must BIND the VISION:Builder DBRM and the user program DBRM together into one plan that will be used to run the VISION:Builder application.

The user program and VISION:Builder must be using the same Attach Method; TSO, CALL, IMS.

 Sample test case steps:

  • Do a BIND of the VISION:Builder DBRM for TSO Attach and the DBRM for the DB2 Utility DSNTEP2 into a single plan.
  • Set up JCL to run VISION:Builder using TSO Attach.
  • Provided JCL for the Utility DSNTEP2,  SYSPRINT, SYSIN.
  • Added a “CALL MODULE DSNTEP2” to our application.  The application is written in ASL (Advanced Syntax Language).  The CALL was conditional, it would only execute one-time.
  • Executed the VISION:Builder application. The standard VISION:Builder reports at M4LIST, and the utility output at SYSPRINT.