C programming language supplement
C is supported in API mode only, using QUICKSAM CALLs for sequential I/O.
Refer to COBOL Programming Language Supplement in this manual for overall strategies for incorporating QUICKSTART into an application program. This is meant to function as a supplement to COBOL Programming Language Supplement to address specifics of the C programming language and to present C coding examples.
There are three primary deviations from normal C coding styles when incorporating QUICKSTART into C application programs:
- In lieu of using C functions to read from or write to sequential files, the C program issues QUICKSAM() function calls. 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.
- In lieu of executing a DBMS checkpoint, the C program executes function QSCALLIT(CKPTRTN), which manages the necessary coordination between the DBMS, the program data, 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. This Section deals with how the application program must incorporate the services of QUICKSTART to ensure restartability.
A C program must execute function ESTAEOFF().
The invocation of the Checkpoint Routine must be done via the QUICKSTARTsupplied function QSCALLIT.
See example programs CDEMO (non-DBMS applications) and CDEMODB2 (DB2 applications) in the SAMPLIB.
This section contains the following topics:
Related topic