The steps shown in Figure 33 summarize how to prepare your
program for execution after your application program design and coding is
complete.
For an overview of the stages in this process, see Preparing a CICS application program that accesses DB2.
When you prepare CICS® application programs that access DB2®:
- The DB2 precompiler (Step 1) builds a DBRM that contains information
about each of the program's SQL statements. It also validates SQL statements
in the program. For more information about using the DB2 precompiler, see
the DB2 Universal Database™ for OS/390® and z/OS® Application Programming and SQL Guide.
- If the source program is written in PL/I, the input to Step 1, the DB2
precompiler, is the output from the PL/I macro phase (if used).
- You can run Step 1, the DB2 precompiler, and Step 2, the CICS command
language translator, in either sequence. The sequence shown is the preferred
method, and it is the method supported by the DB2I program preparation panels.
If you run the CICS command language translator first, it produces a warning
message for each EXEC SQL statement it encounters, but these messages have
no effect on the result.
- If you use one of the Language Environment®-conforming compilers
(COBOL and PL/I) that has integrated the CICS translator, translation of the
EXEC CICS commands (Step 2) takes place during program compilation (Step
3). See the CICS Application Programming Guide for more information on the
integrated CICS translator and the compilers that support it.
- If you are running DB2 Version 7 or later and preparing a COBOL or PL/I
program using one of the Language Environment-conforming COBOL or PL/I compilers,
the compiler also provides an SQL statement coprocessor (which produces a
DBRM), so you do not need to use the separate DB2 precompiler (Step 1). See
the DB2 Universal Database for OS/390 and z/OS Application Programming and SQL Guide for more information on using the SQL statement
coprocessor.
- If you are running DB2 Version 6 or earlier and preparing a COBOL or PL/I
program, use the separate DB2 precompiler. For a COBOL program, ensure that
you specify a string delimiter that is the same for the DB2 precompiler and
the integrated CICS translator. The default delimiters are not compatible.
- In the link edit of the program (Step 4), include both the appropriate
CICS EXEC interface module, or stub, for the language in which you are coding,
and the CICS DB2 language interface module DSNCLI. The CICS EXEC interface
module must be included first in the load module.
(For more information on the CICS EXEC interface modules, see the CICS Application Programming Guide.) You can link DSNCLI with your program in either 24-bit
or 31-bit addressing mode (AMODE=31). If your application program runs in
31-bit addressing mode, you should link-edit the DSNCLI stub to your application
with the attributes AMODE=31 and RMODE=ANY so that your application can run
above 16MB.
- The bind process (Step 5) requires DB2. The bind process uses the DBRM
to produce an application plan (often just called a plan) which enables the
program to access DB2 data. See The bind process for more information
on the bind process. Note that a group of transactions using the same entry
thread (in other words, specified in the same DB2ENTRY) must use the same
application plan. Their DBRMs must be bound into the same application plan,
or bound into packages that are then listed in the same application plan.
Table 9 shows the tasks that you need to perform to prepare
a CICS DB2 program, depending on the language of the program and on your
version of DB2:
Table 9. Tasks to prepare a CICS program that accesses DB2
DB2 version and program language |
Step 1 (SQL statement processing) |
Step 2 (CICS command translation) |
Step 3 (Program compile) |
Step 4 (Link-edit) |
Step 5 (Bind) |
DB2 V6 and Assembler |
DB2 precompiler |
CICS-supplied separate translator |
Language compiler |
Link-edit with EXEC interface and DSNCLI |
Bind process |
DB2 V6 and PL/I |
DB2 precompiler |
Language compiler that
supports integrated CICS translator |
Link-edit with EXEC interface and DSNCLI |
Bind process |
DB2 V6 and COBOL |
DB2 precompiler |
Language compiler that
supports integrated CICS translator |
Link-edit with EXEC interface and DSNCLI |
Bind process |
DB2 V6 and other languages |
DB2 precompiler |
CICS-supplied separate translator |
Language compiler |
Link-edit with EXEC interface and DSNCLI |
Bind process |
DB2 V7 or V8 and Assembler |
DB2 precompiler |
CICS-supplied separate translator |
Language compiler |
Link-edit with EXEC interface and DSNCLI |
Bind process |
DB2 V7 or V8 and PL/I |
Language compiler that
supports integrated CICS translator and SQL statement coprocessor |
Link-edit with EXEC interface and DSNCLI |
Bind process |
DB2 V7 or V8 and COBOL |
Language compiler that
supports integrated CICS translator and SQL statement coprocessor |
Link-edit with EXEC interface and DSNCLI |
Bind process |
DB2 V7 or V8 and other languages |
DB2 precompiler |
CICS-supplied separate translator |
Language compiler |
Link-edit with EXEC interface and DSNCLI |
Bind process |
You can perform this program preparation using the DB2 Interactive Interface
(DB2I) or by submitting your own JCL for batch execution.
- DB2 Interactive Interface (DB2I): DB2I provides panels to precompile,
compile or assemble, and link-edit an application program and to bind the
plan. For details about application program preparation, see the DB2 Universal Database for OS/390 and z/OS Application Programming and SQL Guide.
- User JCL submitted to batch execution: Members DSNTEJ5C and DSNTEJ5P in
the DB2 library, SDSNSAMP, contain samples of the JCL required to prepare
COBOL and PL/I programs for CICS.
If you perform this process while CICS is running, you may need to issue
a CEMT NEWCOPY command to make the new version of the program known to CICS.
DSNTIAR, the IBM®-supplied SQLCODE message formatting procedure, lets
you send a sort of "SQL messages online"
to your application.
With DB2 Version 3 Release 1, DSNTIAR was split into two front-end modules
(DSNTIAC and DSNTIAR) and a run-time module (DSNTIA1). DSNTIAC is used for
CICS applications and DSNTIAR for other
DB2 interfaces. This change removed the need, previous to DB2 3.1, to relink-edit
your application modules every time a change is made to DSNTIAR, either by
change of release or by applying maintenance. If you have applications that
have previously been link-edited with DSNTIAR, you should consider link-editing
them again using DSNTIAC instead, which will provide performance improvments
and isolate them from changes to DSNTIAR.
The CICS front-end part, DSNTIAC, is supplied as a source member in the
DB2 library SDSNSAMP.
The necessary program definitions for DSNTIAC and DSNTIA1 are provided
in IBM supplied group DFHDB2 on the CSD. You must add the SDSNLOAD library
to the CICS DFHRPL concatenation (after the CICS libraries) so that DSNTIA1
can be loaded.
[[ Contents Previous Page | Next Page Index ]]