Using QMF


Connecting to a remote location from a procedure

The QMF CONNECT command lets you connect to another user ID or to a remote DB2 or SQL/DS database to use the remote unit of work support. You can use this command with a linear procedure or a procedure with logic.

You cannot use the CONNECT command from DB2 for VSE. However, you can use DB2 for VSE as a server and connect to it from either DB2 or DB2 for VM.

In the following example, suppose that you are an administrator in Miami, and you want to write a procedure that:

The procedure looks like the one that is shown in Figure 159.

Figure 159. This procedure uses the CONNECT command.


 
CONNECT TO DALLAS                          -- SQL executed in Dallas
RUN PROC GENERATE_REPORT (FORM=GEN_FORM    -- Issue QMF commands
PRINT REPORT                               -- Report printed in Miami
CONNECT TO MIAMI

Make sure that you store the procedure at the current location, in the same database to which you are connected when you issue the RUN PROC command. When you connect to a new location, QMF re-initializes your profile, except for the value of TRACE. It also re-initializes command synonyms and function keys to the values at the new (current) location.

When you write procedures that use the QMF CONNECT command to access remote databases, keep the following guidelines in mind:

For more information about using the QMF CONNECT command and remote unit of work support, see the QMF Reference, SC26-4716-05.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]