Checking File Residence

You can design a program to read the AVAILABLE or RESIDENT attributes of a file before attempting to open the file. RESIDENT returns a value of TRUE or FALSE to indicate whether the file is available. AVAILABLE returns a numeric value indicating whether the file can be opened, and if not, why not.

If the file is available, the program can execute an OPEN statement. If the file is not available, the program can skip the OPEN statement and take whatever recovery actions are deemed appropriate by the programmer.