Compile and Link requirements
Compile your COBOL program using the NORENT and RES compile options.
COBOL modules involved in the application run unit which issue SQL calls must first run through the DB2 pre-compiler. The DB2 pre-compiler generates Working Storage fields, including the Timestamp, to support the SQL calls. To enable the ability to make source code changes between restarts in these modules, this generated Working Storage should not be saved during checkpoint processing. If the Working Storage is checkpointed, then when the program is recompiled, it will be given new Timestamps which will match a newly created DBRM. At restart time, Working Storage will be restored with the old Timestamps, and when the first SQL instruction is executed, it will return either a 805 or 818.
To avoid this pitfall, add the COBOL compiler option of 'EXIT(INEXIT(QSTDB2))' to the compile step of the program and recompile. Make sure the QUICKSTART load library is available in the STEPLIB DD of the compile step. This compile option will automatically add one Working Storage eye-catcher field to the application which will tell QUICKSTART where the DB2 generated Working Storage begins so that it will not be saved at checkpoint time. This step is not necessary for modules that do not issue SQL calls. Optionally, the following Working Storage eye-catcher field can be added manually to the end of Working Storage:
It can also be added using the statement:
Preventing DB2 generated working storage from being checkpointed with either of the previous methods allows you to make source code changes to your application programs between restarts.
All CALLs to subprograms that need to be restartable must be called dynamically. Dynamic calls to subprograms can be accomplished by using one of the following methods:
- Use the CALL-identified format of the COBOL CALL statement.
- Compile by using the DYNAM option.
- Use the QUICKSTART module QSCALLIT to call the subprogram (see Using).
Ensure that the QUICKSTART load library is available in the STEPLIB DD statement of the compile step.
If your application program uses sequential files, link the program by using RMODE(24).
Link COBOL II subprograms that need to be restartable with the REUS link option.
For DB2 applications, ensure that the BIND includes the QSTART packages or the CKPTRTN and QSISXRST DBRMs.
If using sequential files, link using RMODE(24). Subprograms also need the REUS link option. Transparent Mode applications must use QUICKSTART’s supplied DB2 Call Attach Facility, BATCHCAF. See BATCHCAF—DB2 Call Attach Facility Interface for Link and JCL requirements.
Related topic