COBOL programming language supplement
There are three primary deviations from normal COBOL coding styles when incorporating QUICKSTART into COBOL programs:
- QUICKSTART must perform all I/O operations for all sequential files requiring restart support. This can be accomplished in either of two ways.
- The most common technique is to use QUICKSTART’s FD Interception Feature, which works as follows:
In lieu of issuing COBOL OPEN and CLOSE statements in the program, use the QUICKSTART provided COBOL copybooks QSOPENI, QSOPENO, and QSCLOSE. QSOPENI generates code to OPEN a COBOL FD for input with QUICKSTART FD Interception turned on. Likewise, QSOPENO is used to OPEN a COBOL FD for output. Finally, QSCLOSE is used to CLOSE the FD. Most sites prefer this technique because is preserves the “look and feel” of normal COBOL I/O processing and is easier to retrofit into existing applications. - The other technique available to place sequential files under QUICKSTART control is to use the QUICKSAM API, which works as follows:
In lieu of COBOL “FD” Statements and COBOL Verbs such as “READ” and “WRITE” to perform file I/O functions, the COBOL program issues “CALLs” to QUICKSAM to perform the necessary READs from, and WRITEs to, the appropriate sequential files. This allows QUICKSTART to accurately track the status of sequential files for proper repositioning, should there be a need for a restart at some later time.
If QUICKSAM API is CALLed directly, files are automatically OPENed and CLOSEd by the initial and final PERFORMs of CKPT-RTN. It also creates a standard interface across all languages and platforms that QUICKSTART runs in. On the other hand, the COBOL verb method requires the application program to perform each OPEN and CLOSE. But it is much easier for making an existing application restartable and requires less training. More information about COBOL FD Interception is contained in FD-interception-technique.
- The most common technique is to use QUICKSTART’s FD Interception Feature, which works as follows:
- In lieu of issuing a “CALL” to the appropriate DBMS at checkpoint time to COMMIT all prior updates, the COBOL program invokes the Checkpoint Routine. This can be done by a CALL to a QUICKSTART Checkpoint Routine API, or by a “PERFORMs” paragraph CKPT-RTN which contains an INCLUDEd or COPY’d Checkpoint Routine. This API or included paragraph invokes QUICKSTART to manage the necessary coordination between the DBMS, the Working Storage, and the QUICKSAM-controlled sequential files.
- Application programs must incorporate into their design the concept of the Logical Unit of Work. Note that most batch application programs already incorporate this design feature, since it is frequently used in conjunction with issuing any necessary DBMS “COMMIT” activity.
- A truly restartable application program must allow QUICKSTART to issue all necessary checkpoints, to include checkpointing of the Checkpoint Area, and to control all sequential file operations. The following section deals with how the application program must incorporate the API services of QUICKSTART to ensure restartability.
- The QUICKSTART SAMPLIB contains sample programs which use the techniques discussed on the following pages. These programs all perform the same function, namely to read records from a sequential input file, and write them to an output file. After a number of read/writes QUICKSTART is invoked to perform checkpoint processing. See JCL for sample program names.
This section contains the following topics:
Related topic
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*