Compiling and link-editing an application
If you use the DB2® precompiler, your next step in the program preparation process is to compile and link-edit your program. As with the precompile step, you have a choice of methods.
About this task
- DB2I panels. For details, see DB2I panels that are used for program preparation.
- The DSNH command procedure (a TSO CLIST). For details, see DSNH (TSO CLIST).
- JCL procedures supplied with DB2. For details, see DB2-supplied JCL procedures for preparing an application.
- JCL procedures supplied with a host language compiler.
If you use the DB2 coprocessor, you process SQL statements as you compile your program. For programs other than C and C++ programs, you must use JCL procedures when you use the DB2 coprocessor. For C and C++ programs, you can use either JCL procedures or UNIX System Services on z/OS® to invoke the DB2 coprocessor.
The purpose of the link-edit step is to produce an executable load module. To enable your application to interface with the DB2 subsystem, you must use a link-edit procedure that builds a load module that satisfies environment-specific requirements.
IMS and DB2 share a common alias name, DSNHLI, for the language interface module. You must do the following when you concatenate your libraries:
- If you use IMS, be sure to concatenate the IMS library first so that the application program compiles with the correct IMS version of DSNHLI.
- If you run your application program only under DB2, be sure to concatenate the DB2 library first.
You also need the CICS EXEC interface module that is appropriate for the programming language. CICS requires that this module be the first control section (CSECT) in the final load module.
The size of the executable load module that is produced by the link-edit step varies depending on the values that the SQL statement processor inserts into the source code of the program.