There are two cases to consider when a subprogram is invoked by VISION:Builder to perform DB2 commands.
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: