24.11.2014 Views

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Language</strong> <strong>Reference</strong><br />

FILE = fin<br />

fin is a character expression whose value when trailing blanks are removed is the name of<br />

a file to be connected to the specified unit. If this specifier is omitted and the unit is not<br />

connected to a file, it becomes connected to a file determined by <strong>Open</strong> <strong>Watcom</strong> <strong>FORTRAN</strong><br />

<strong>77</strong>. The name established by <strong>Open</strong> <strong>Watcom</strong> <strong>FORTRAN</strong> <strong>77</strong> is described in the section<br />

entitled "Units" on page 219 of the chapter entitled "Input/Output"<br />

STATUS = sta<br />

sta is a character expression whose value when trailing blanks are removed is ’OLD’,<br />

’NEW’, ’SCRATCH’, or ’UNKNOWN’.<br />

OLD<br />

NEW<br />

SCRATCH<br />

UNKNOWN<br />

When OLD is specified, a FILE= specifier must be given. The file<br />

must exist.<br />

When NEW is specified, a FILE= specifier must be given. The file<br />

must not exist. Successful execution of the OPEN statement creates the<br />

file and changes the status to OLD.<br />

SCRATCH may only be specified for an unnamed file (i.e. FILE= is<br />

not allowed). When the file is closed, it is deleted.<br />

If UNKNOWN is specified, the status is ignored. If the STATUS=<br />

specifier is omitted then UNKNOWN is assumed.<br />

ACCESS = acc<br />

acc is a character expression whose value when trailing blanks are removed is<br />

’SEQUENTIAL’ or ’DIRECT’. It specifies the access method for the file. If the<br />

ACCESS= specifier is omitted then ’SEQUENTIAL’ is assumed. If the file exists then the<br />

access method must be in the set of allowed access methods for the file. If the file does not<br />

exist then the file is created with a set of allowed access methods that includes the specified<br />

access method.<br />

<strong>Open</strong> <strong>Watcom</strong> <strong>FORTRAN</strong> <strong>77</strong> also supports access ’APPEND’ which is a form of<br />

sequential access in which the file is positioned at the endfile record. The file must exist or<br />

the append access method must be in the set of allowed access methods for the file. In all<br />

other respects, the file is treated as if ’SEQUENTIAL’ had been specified.<br />

FORM = fm<br />

RECL = rcl<br />

fm is a character expression whose value when trailing blanks are removed is<br />

’FORMATTED’ or ’UNFORMATTED’. It specifies that the file is being connected for<br />

formatted or unformatted input/output. If the FORM= specifier is omitted and the file is<br />

being connected for direct access then ’UNFORMATTED’ is assumed. If the FORM=<br />

specifier is omitted and the file is being connected for sequential access then<br />

’FORMATTED’ is assumed. If the file exists then the specified form must be included in<br />

the set of allowed forms for the file. If the file does not exist then the file is created with a<br />

set of allowed forms that includes the specified form.<br />

rcl is an integer expression whose value must be positive. It specifies the length of each<br />

record in a file being connected for direct access. If the file is being connected for direct<br />

access, this specifier must be given; otherwise it must be omitted. <strong>Open</strong> <strong>Watcom</strong><br />

<strong>FORTRAN</strong> <strong>77</strong> allows the RECL= specifier for files opened for sequential access.<br />

112 OPEN Statement

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!