Invoking multiple SQL programs through ISPF and DSN

You can break a large application into several different functions. Each function communicates through a common pool of shared variables, which is controlled by ISPF.

About this task

You might write some functions as separately compiled and loaded programs, others as EXECs or CLISTs. You can start any of those programs or functions through the ISPF SELECT service, and you can start that from a program, a CLIST, or an ISPF selection panel.

When you use the ISPF SELECT service, you can specify whether ISPF should create a new ISPF variable pool before calling the function. You can also break a large application into several independent parts, each with its own ISPF variable pool.

You can call different parts of the program in different ways. For example, you can use the PGM option of ISPF SELECT:
PGM(program-name) PARM(parameters)
Alternatively, you can use the CMD option:
CMD(command)
For a part that accesses Db2, the command can name a CLIST that starts DSN:
DSN
    RUN PROGRAM(PART1) PLAN(PLAN1) PARM(input from panel)
END

Breaking the application into separate modules makes it more flexible and easier to maintain. Furthermore, some of the application might be independent of Db2; portions of the application that do not call Db2 can run, even if Db2 is not running. A stopped Db2 database does not interfere with parts of the program that refer only to other databases.

Disadvantages: The modular application, on the whole, has to do more work. It calls several CLISTs, and each one must be located, loaded, parsed, interpreted, and executed. It also makes and breaks connections to Db2 more often than the single load module. As a result, you might lose some efficiency.