bdfp1m1q | Programming Concepts and Reference |
Use this group of functions to write a file, or part of a file, to a
real-time tape, a general tape, or a sequential data set.
Format
void dftlg(dft_fil *file, dft_opt options, dft_tpn *tape);
void dftlg_acc(dft_fil *file, dft_opt access, dft_opt options,
dft_tpn tape, dft_xxx acc);
void dftlg_inc(dft_fil *file, dft_opt options, dft_tpn *tape,
dft_idl *inc_list);
void dftlg_acc_inc(dft_fil *file, dft_opt access, dft_opt options,
dft_tpn tape, dft_xxx acc, dft_idl *inc_list);
- 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:
- DFTLG_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.
- DFTLG_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.
- DFTLG_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.
- inc_list
- is a pointer to a list of file IDs that you want to be included in the
action of the function.
- options
- are the processing options for this function. Use the following
values:
- DFTLG_DELETE
- deletes all the LRECs in the DASD file after the records are written to
tape or sequential data set. Any previously used blocks are returned to
pool.
- DFTLG_FULLFILE
- writes LRECs from the whole input file (not from a single subfile) to tape
or sequential data set.
- DFTLG_INITIALIZE
- deletes all the LRECs in the DASD file after the records are written to
tape or sequential data set. Any previously used blocks are returned to
pool, except the prime block.
- 0
- specifies that you do not want to use any processing options.
- tape
- is a pointer to a character array holding the 3-character tape
name.
Entry Requirements
None.
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.
- After opening a file, if you use fullfile processing to access or
update records, you must continue to use fullfile processing on any subsequent
functions when available until the file is closed. Accessing or
updating subfiles using fullfile processing cannot be mixed with functions
that access or update records without using fullfile processing.
- The dftlg function does not write the B+Tree index
information to tape because it is rebuilt when the B+Tree data file
is restored.
- If you specify the DFTLG_FULLFILE value and the end-of-file indicator is
set, you cannot issue additional TPFDF functions until the file is
closed. However, you can specify the DFCLS_REUSE option on the
dfcls function. See Identifying Return Indicators and Errors for information about the end-of-file
indicator.
- If you use the dftlg function in a commit scope, a rollback of
the commit scope will not restore the contents or the position of the
tape. See Commit Scopes for more information about commit scopes.
Examples
- The following example writes a complete file to tape. A pointer to
the 3-character tape name is in tape_name.
dft_tpn *tape_name;
dft_fil *file_ptr;
·
·
·
dftlg(file_ptr, 0, tape_name);
- The following example writes a subfile, specified in alg_ptr to
tape. A pointer to the tape name is in tape_name. It deletes
LRECs in the subfile after the write.
dft_tpn *tape_name;
dft_alg *alg_ptr;
dft_fil *file_ptr;
·
·
·
dftlg(file_ptr, DFTLD_ALG, DFTLG_INITIALIZE, tape_name, alg_ptr);
Related Functions