## 13.6.28 STATUS Specifier

The STATUS specifier indicates the status of a file when it is opened. It takes the following form:

  STATUS = sta
  sta
  Is a scalar default character expression that evaluates to one of the following values:

  '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 and its status changes to 'OLD'.

Scratch files go into a temporary directory and are visible while they are open. (For more information, see your user manual or programmer's guide.)

The default is 'UNKNOWN'. This is also the default if you implicitly open a file by using WRITE. However, if you implicitly open a file using READ, the default is 'OLD'. If you specify compiler option F66 (or OPTIONS /NOF77), the default is 'NEW'. For the correct form of this option, see your user manual or programmer's guide.

  Note: The STATUS specifier can also appear in CLOSE statements to indicate the file's status after it is closed. However, in CLOSE statements the STATUS values are the same as those listed for the DISPOSE specifier (see Section 13.6.12).

Previous Page Next Page Table of Contents