WAITFILE parameter
You use the WAITFILE parameter to specify the following:
- For the maximum number of seconds that a program waits for file resources to be allocated when the file is opened
- For session resources when the evoke function is issued for an APPC device
- For the device to be allocated when an acquire operation is performed to read the file
If the program must wait, it will be placed in a wait state until the resources are available or until the wait time expires. If two or more file resources are needed and are not available because they are being used by different system users, the acquisition of each resource might require a wait. This maximum is applied to each wait.
The length of the wait can be specified in this parameter, or the default wait time of the class that applies to the object can be used. If the file resources cannot be allocated in the specified number of seconds, an error message is returned to the program.
The file resources that must be allocated depend on the type of file being opened. File resources consist of the following.
- For device files that are not spooled (SPOOL(*NO)), the file resources include the file description and device description. Because the device description must be allocated, the device itself must also be available.
- For device files that are spooled (SPOOL(*YES)), the file resources include the file description, the specified output queue, and storage in the system for the spooled data. Because the data is spooled, the device description (and thus the device itself) need not be available.
- For database files, the file resources consist of the file and member data. The file's associated member paths are not accessed, and therefore, the system does not wait for them. A file open exception error can occur before the WAITFILE time has expired when an access path is not available (for example, when the access path is being rebuilt).
The Allocate Object (ALCOBJ) command can be used to allocate specific file resources before the file is opened.
The session resources that were allocated for an APPC device conversation can be lost between the time the application issues a detach function or receives a detach indication and the time another evoke function is issued. If the session resource is lost, this parameter is used to determine the length of time that the system waits for another session resource.
Values allowed
*IMMED: The program does not wait; when the file is opened, an immediate allocation of the file resources is required.
*CLS: The default wait time specified in the class description is used as the wait time for the file resources to be allocated.
number-of-seconds: Specify the maximum number of seconds that the program waits for the file resources to be allocated. Valid values range from 1 through 32767 seconds.