dftrd: Read a subfile from an input tape to main storage
Use this function to read a subfile from an input tape or sequential data set to main storage.
Last updated
- Changed in 2020.
- Changed for PUT10.
- Changed for PUT07.
- Changed for PUT05.
- Changed for PUT00.
Format
void dftrd(dft_fil *file, dft_tpn *tape); - file
- A pointer to the base address of the SW00SR slot (defined in c_sw00sr.h) of the file that you want to access and is returned by the dfifb or dfopn function. Use the acc parameter to specify a particular subfile to access. If you do not specify the acc parameter, the last subfile accessed with this SW00SR slot will be accessed.
- tape
- A pointer to a variable containing the 3-character symbolic tape name or sequential data set.
Entry requirements
None.
Return conditions
None.
Error return
For information about how to check the error indicators, see Identifying return indicators and errors.
Programming considerations
- The type definitions (for example,
dft_fil,dft_ref, anddft_kyl) are defined in the c_cdfapi.h header file. - The dftrd function reads one subfile at a time. After you call the dftrd function, you must then call the dftld function before reading another subfile. (You can use the DFTLD_SKIP option with dftld to ignore the subfile.)
- If you use the dftrd function in a commit scope, a rollback of the commit scope will not restore the position of the tape.
- You cannot use this function with P-type files unless the forward chain field is a 4-byte address located at displacement 8 from the start of the block.
- This function does not support files that can have subfiles stored in a remote data store. If this function is called for a file with the REMOTEALLOW=YES parameter specified in the DBDEF macro, a DB014A system error is issued and the function returns to the application with appropriate error indicators set.
Examples
The following example reads a subfile from tape to main storage. A pointer to the 3-character
tape name is in tape_name.
dft_tpn *tape_name;
dft_fil *file_ptr;
⋮
dftrd(file_ptr, tape_name);