## 9.6.26 STATUS Keyword

The STATUS keyword specifies the type of file that you want to open. It takes the following form:

    STATUS = sta

sta
  Is a character expression with one of the following values:

  - 'OLD': Open a previously created file.

  - 'NEW': Create a new file.

  - 'SCRATCH': Create a new file and delete it when it closes.

  - 'UNKNOWN': First try 'OLD'; if the file is not found, use 'NEW' and create a new file (using the next highest available version number).

The default is 'UNKNOWN'. However, if you implicitly open a file by using WRITE, or you specify the compiler option NOF77 (or OPTIONS /NOF77), the default value is 'NEW'. If you implicitly open a file by using READ, the default value is 'OLD'.

Scratch files (STATUS='SCRATCH') are created on the user's default disk (SYS$DISK) and are not placed in a directory or given a name that is externally visible. To specify a different device, use the FILE keyword.

Note
  The STATUS keyword is also used in CLOSE statements to specify the status of a file after the file is closed. However, in CLOSE statements the STATUS values are the same as those listed for the DISPOSE keyword (see Section 9.6.9).

Previous Page Next Page Table of Contents