bdfp1m14 | Programming Concepts and Reference |
Use this group of functions to copy a subfile. After processing the function, the TPFDF product closes the subfile and performs all subsequent actions on the copy.
Format
dft_hdr *dfcpy(dft_fil *file, dft_opt options);
dft_hdr *dfcpy_acc(dft_fil *file, dft_opt access, dft_opt options, dft_xxx acc);
dft_hdr *dfcpy_toa(dft_fil *file, dft_opt options, dft_fad toa);
dft_hdr *dfcpy_acc_toa(dft_fil *file, dft_opt access, dft_opt options, dft_xxx acc, dft_fad toa);
dft_hdr *dfcpy_acc_pth(dft_fil *file, dft_opt access, dft_opt options, dft_xxx acc, dft_pth pth);
dft_hdr *dfcpy_acc_toa_pth(dft_fil *file, dft_opt access, dft_opt options, dft_xxx acc, dft_fad toa, dft_pth pth);
|
The TPFDF product uses the algorithm argument to determine the subfile (ordinal number) that is to be accessed. Specify the algorithm argument based on the type of algorithm that is defined in the DSECT or DBDEF macro for the file. If the DSECT or DBDEF macro defines the #TPFDB04 or the #TPFDB0D algorithm, do not use this parameter.
If the subfile you are accessing is contained in a detail file or intermediate index file defined with the #TPFDBFF algorithm, the TPFDF product uses the algorithm argument to locate the subfile. See TPFDF Database Administration for more information about how the TPFDF product uses the algorithm argument to locate the subfile.
If the file is partitioned or interleaved, specify the relative ordinal number within the partition or interleave. If the file is not partitioned or interleaved, specify the file address compute program (FACE) ordinal number.
See TPFDF Database Administration for more information about path indexes.
If used in a commit scope, the prime block specified by the toa parameter must be opened in the same commit scope as the subfile that is being copied. See Commit Scopes for more information about commit scopes.
Entry Requirements
None.
Normal Return
A pointer to the main storage address of the header of the prime block of the copy of the subfile.
Error Return
See Identifying Return Indicators and Errors for information about how to check the error indicators.
Programming Considerations
Examples
The following example copies a subfile to pool blocks. (The TPFDF product sets a pointer to the header in block_ptr.)
dft_fil *file_ptr; dft_hdr *block_ptr;
·
·
·
block_ptr = dfcpy(file_ptr, 0);
Related Functions