dfwait: Wait for completion
Use this function to wait for completion of all outstanding I/O operations for this ECB and to complete all z/TPFDF processing to access all subfiles that you opened by issuing the dfopn function with the DFOPN_PREFETCH_PRIME value specified.
If you issue the dfopn function with the DFOPN_PREFETCH_PRIME value specified to open subfiles, you must issue the dfwait function before you call any z/TPFDF APIs for these subfiles.
Last updated
Added for PUT11.
Format
dft_nbr dfwait(void); Entry requirements
None.
Normal return
- Function processing returns 0.Note: If you issue this function, a waitc function is issued whether or not you previously issued a dfopn function with the DFOPN_PREFETCH_PRIME value specified. If you previously did not issue a dfopn function with the DFOPN_PREFETCH_PRIME value specified, a value of 0 is returned.
- In all processed SW00SR slots, the following situations occur:
- The SW00RTN error indicator field is set to 0.
- The SW00REC field contains the core address of the prime block.Note: This result is equivalent to dfred function processing with the DFRED_HEADER value specified for the subfile.
Error return
- Function processing returns the number of subfiles (SW00SR slots) that were opened with the DFOPN_PREFETCH_PRIME value specified and that had an I/O failure.
- In all processed SW00SR slots that have an error, the following
situations occur:
- Bit 0 of the error indicator field SW00RTN is set to 1.
- The SW00REC field is set to 0.
Note: Any return-optional system errors that occur during dfopn function processing
are not reflected in the number of failed I/O operations upon return
from dfwait function
processing. Check for errors on the dfopn function call.
Programming considerations
- If you issue this function, all outstanding I/O operations are completed, including I/O operations that the z/TPFDF product did not initiate. The z/TPFDF product identifies only errors that occurred from dfopn function processing with the DFOPN_PREFETCH_PRIME value specified. The application is responsible for checking for any additional errors.
Examples
In the following example, four subfiles are opened, and the retrieval of the prime blocks are
immediately initiated. Two of the subfiles are opened with a hold. The subsequent dfwait function completes the access of all the subfiles.
After successful completion, the subfiles are ready for use.
dft_fil *sw_ptr_01;
dft_fil *sw_ptr_02;
dft_fil *sw_ptr_03;
dft_fil *sw_ptr_04;
sw_ptr_01 = dfopn_acc("GR00SR01", "G0", DFOPN_ALG,
DFOPN_PREFETCH_PRIME, "A");
sw_ptr_02 = dfopn_acc("IR90DF ", "\xBD\x90", DFOPN_ORD,
DFOPN_HOLD|DFOPN_PREFETCH_PRIME, 12);
sw_ptr_03 = dfopn_acc("GR00SR02", "G0", DFOPN_ALG,
DFOPN_HOLD|DFOPN_PREFETCH_PRIME, "B");
sw_ptr_04 = dfopn_acc("IR90DF ", "\xBD\x90", DFOPN_ORD,
DFOPN_PREFETCH_PRIME, 6);
if (dfwait() != 0)
{
// Find each SW00SR marked with a serious error
sw_ptr_wait = dfifb_fst(); // loacte 1st SW00SR
while (sw_ptr_wait != NULL) // loop trough all SW00SR
{
if (DF_ER(sw_ptr_wait)) // serious error detected
{
// error processing for this 'error SW00SR'
}
sw_ptr_wait = dfifb_nxt(); // loacte next SW00SR
} // end SW00SR loop
}
⋮