The STATUS specifier indicates the status of a file when it is opened. It takes the following form:
'OLD' | Indicates an existing file. |
'NEW' | Indicates a new file; if the file already exists, an error occurs. Once the file is created, its status changes to 'OLD'. |
'SCRATCH' | Indicates a new file that is unnamed (called a scratch file). When the file is closed or the program terminates, the scratch file is deleted. |
'REPLACE' | Indicates the file replaces another. If the file to be replaced exists, it is deleted and a new file is created with the same name. If the file to be replaced does not exist, a new file is created and its status changes to 'OLD'. |
'UNKNOWN' | Indicates the file may or may not exist. If the file does not exist, a new file is created (using the next highest available version number) and its status changes to 'OLD'. |
The default is 'UNKNOWN'. However, if you implicitly open a file using WRITE or you specify compiler option /NOF77 (or OPTIONS/NOF77), the default value is 'NEW'. If you implicitly open a file using READ, the default value is 'OLD'.
Scratch files (STATUS='SCRATCH') are created on your default disk (SYS$DISK) and are not placed in a directory or given a name that is externally visible. To indicate a different device, use the FILE specifier.