bdfp1m1p | Programming Concepts and Reference |
Use this function to do one of the following:
- Write the subfile to DASD
- Ignore the subfile.
Format
void dftld(dft_fil *file, dft_opt options);
void dftld_acc(dft_fil *file, dft_opt access, dft_opt options,
dft_xxx acc);
- acc
- is an ordinal number, a file address, or a pointer to an algorithm string
that specifies the subfile you want to access. The type for this
parameter is determined by the value you specify for the access
parameter.
- access
- is the method you want to use to access the subfile. Use one of the
following values:
- DFTLD_ALG
- specifies that you are providing a pointer to an algorithm argument in the
acc parameter. The acc parameter is of type
dft_alg.
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.
- DFTLD_FADDR
- specifies that you are providing a file address in the acc
parameter. A file address is in integer format. The acc
parameter is of type dft_fad.
- DFTLD_ORD
- specifies that you are providing an ordinal number in the acc
parameter. Ordinal numbers in a file start at zero and are in integer
format. The acc parameter is of type
dft_ord.
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.
- 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 the following
values:
- DFTLD_CREATE
- writes the subfile to new pool blocks in DASD. (The default is to
use the same file addresses as before.)
- DFTLD_SKIP
- discards the blocks that were read from tape or sequential data set with
the dftrd function. The dftld function releases
all the blocks, both prime and chained, that the dftrd function
retrieved and placed in main storage.
You can use the DFTLD_SKIP value in a restart situation when a number of
blocks need to be read from tape or sequential data set to reach the point
where a system failure occurred. (All the blocks up to the failure
point have already been written to DASD, so you only need to read them without
saving them again.)
The DFTLD_SKIP value is also useful if you want to end the transfer of
information from tape to disk, or if there are unwanted blocks of data on a
tape or sequential data set.
- 0
- specifies that you do not want to use any processing options.
Entry Requirements
You must successfully read a subfile using the dftrd function
before calling the dftld function.
Normal Return
None.
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.
- Some parameters can be of different types based on the value you
specify for that parameter or a related parameter. In the function
format, the type of these parameters is shown as
dft_xxx. See the description of the specific
parameter for information about what type definition to use for that
parameter.
- You must always call dftld after calling
dftrd. No other function calls are allowed between the
dftld and dftrd calls. Ensure your application
checks for any error conditions before calling dftld. During
dftrd processing, if an error occurs that causes SW00RTN to be
nonzero, invoking dftld is treated as an incorrect command
sequence.
- The dftld function rebuilds the B+Tree index for
B+Tree files.
- Because the dftld function requires a significant amount of
system resources, do not use this function in a commit scope. See Commit Scopes for more information about commit scopes.
Examples
The following example writes a subfile, specified in alg_ptr, to new pool
blocks in DASD. It ignores any blocks that were read from tape by a
dftrd.
dft_fil *file_ptr;
dft_alg *alg_ptr;
·
·
·
dftld_acc(file_ptr, DFTLD_ALG, DFTLD_SKIP | DFTLD_CREATE, alg_ptr);
Related Functions