bdfp1m1pProgramming Concepts and Reference

dftld-Write a Subfile from Main Storage to DASD

Use this function to do one of the following:

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

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