bdfp1m11 | Programming Concepts and Reference |
Use this function to checkpoint a subfile; that is, all blocks in main
storage that have been changed are copied to DASD.
Format
dft_rec *dfckp(dft_fil *file, dft_opt options);
- file
- is a pointer to the base address of the SW00SR slot (defined in
c$sw00sr.h) of the subfile that you want to access
and is returned by the dfopn function.
- options
- are the processing options for this function. Use one of the
following values:
- DFCKP_DETAC
- places the subfile in detac mode after checkpointing the subfile.
When the subfile is in detac mode, all modified blocks are saved in main
storage.
Any changes that you make to the LRECs in that subfile are not written to DASD
until the subfile is checkpointed or closed. You can discard modified
LRECs (prevent them from being written to DASD) by using the DFCLS_ABORT value
on the options parameter of the dfcls function.
- Note:
- The TPF system and the ALCS environment issues a 000010 system error if an
application program does not give up control in the time allotted by the
application time-out counter. When processing in detac mode, a TPFDF
application program can require more than the allotted time on a database with
a large data structure. To prevent the 000010 system error, you can
change the setting of the &TPFDBDV symbol in the DBLCL macro.
See TPFDF Installation and Customization for more
information about the &TPFDBDV symbol and the DBLCL macro.
- DFCKP_NODET
- specifies that you do not want the subfile in detac mode after it has been
checkpointed.
- DFCKP_TM
- specifies that commit scopes are used during checkpoint processing,
regardless of what the database definition (DBDEF) macro has set as the
default. This option is valuable when you want to file out many files
during checkpoint processing (for example, detac mode, extensive
B+Tree indexing updates, and requests that result in
packing).
- DFCKP_NO_TM
- specifies that commit scopes are not used during checkpoint processing,
regardless of what the DBDEF macro has set as the default.
- 0
- specifies that you do not want to use any processing options.
Entry Requirements
None.
Normal Return
The subfile remains open and the current logical record (LREC) remains the
same.
Error Return
See Identifying Return Indicators and Errors for information about how to check the error
indicators.
Programming Considerations
- The type definitions (for example, dft_fil,
dft_ref, and dft_kyl) are defined in the
c$cdfapi.h header file.
- If you do specify the DFCKP_DETAC or the DFCKP_NODET value, the subfile
remains in the mode currently being used.
- You can use the dfckp function to checkpoint a W-type file to a
short-term pool file.
- For a B+Tree file, the dfckp function checkpoints
the index blocks and the data blocks.
- Processing the dfckp function on a file that is opened in a
commit scope is not visible until the file is committed. If the
checkpointed file is rolled back, updates to the file are discarded.
See Commit Scopes for more information about commit scopes.
Examples
- The following example checkpoints the current subfile.
dft_fil *file_ptr;
·
·
·
(void) dfckp(file_ptr, 0);
- The following example checkpoints a subfile and ensures the subfile is in
detac mode after processing:
dft_fil *file_ptr;
·
·
·
(void) dfckp(file_ptr, DFCKP_DETAC);
Related Functions