Preparing an application to run on DB2 for z/OS
To prepare and run applications that contain embedded static SQL statements or dynamic SQL statements, you must precompile, compile, link-edit, and bind them.
About this task
You can perform these steps by using one of the following methods:
- Applications that contain ODBC calls
- Applications in interpreted languages, such as REXX
- Java applications, which can contain JDBC calls or embedded SQL statements
For information about running REXX programs, which you do not prepare for execution, see Running a DB2 REXX application.
Steps in program preparation
The following topics provide details on preparing and running a DB2 application:
- Processing SQL statements
- Compiling and link-editing an application
- Binding an application
- Running an application on DB2 for z/OS.
Binding a package is not necessary in all cases. These instructions assume that you bind some of your DBRMs into packages and include a package list in your plan.
For more information about when to bind a package, see DB2 program preparation overview.
Preparing applications by using JCL procedures
- Use DB2 interactive (DB2I) panels, which lead you step by step through the preparation process.
- Submit a background job using JCL (which the program preparation panels can create for you).
- Start the DSNH CLIST in TSO foreground or background.
- Use TSO prompters and the DSN command processor.
- Use JCL procedures added to your SYS1.PROCLIB (or equivalent) at DB2 installation time.
- For C and C++ only, you can invoke the coprocessor from UNIX System Services and, if the DBRM is generated in a HFS file, you can use the command line processor to bind the resulting DBRM. Optionally, you can also copy the DBRM into a partitioned data set member by using the oput and oget commands and then bind it by using conventional JCL.
This topic describes how to use JCL procedures to prepare a program.
For information about using the DB2I panels, see Preparing an application to run on DB2 for z/OS.
Preparing applications by the DB2 Program
If you develop programs using TSO and ISPF, you can prepare them to run by using the DB2 Program Preparation panels. These panels guide you step by step through the process of preparing your application to run. Other ways of preparing a program to run are available, but using DB2 Interactive (DB2I) is the easiest because it leads you automatically from task to task.
- The program consists of more than one data set or member.
- More than one data set or member contains SQL statements.
- If you want to display or suppress message IDs during program preparation, specify one of the
following commands on the ISPF command line:
- TSO PROFILE MSGID
- Message IDs are displayed
- TSO PROFILE NOMSGID
- Message IDs are supressed
- Open the DB2I Primary Option Menu.
- Select the option that corresponds to the Program Preparation panel.
- Complete the Program Preparation panel and any subsequent panels. After you complete each panel, DB2I automatically displays the next appropriate panel.
Preparation guidelines for DL/I batch programs