ACCESS = accacc Is a character expression with one of the following values:
'DIRECT' Access by record number 'SEQUENTIAL' Access sequentially (the default) 'KEYED' (VMS only) Access by a specified key 'APPEND' Access sequentially, after the last record of the file
On U*X systems on RISC processors, there are limitations on record access by file organization and record type (see your DEC Fortran user manual).
ASSOCIATEVARIABLE = asvasv Is an integer variable. It cannot be a dummy argument to the routine in which the OPEN statement appears. Use only in direct access mode.
NOTE: Direct access READ, direct access WRITE, FIND, DELETE, and REWRITE statements can affect the value of the variable.
BLANK = blnkblnk Is a character expression with one of the following values:
'NULL' Ignore all blanks in a numeric field (unless the field is all blanks, in which case treat blanks as zero). 'ZERO' Treat all blanks other than leading blanks as zeros.
The default is 'NULL'. However, if you specify the -nof77 compiler option (or OPTIONS /NOF77), the -vms compiler option, or you implicitly open an external or internal file, the default is 'ZERO'.
BLOCKSIZE = bksbks Is a numeric expression.
If you specify a BLOCKSIZE number, it is rounded up to a multiple of 512 byte blocks.
If you do not specify BLOCKSIZE or you specify zero, the filesystem default is assumed.
BUFFERCOUNT = bcbc Is a numeric expression.
The range of values for bc is from 1 to 127.
The BLOCKSIZE keyword determines the size of each buffer. Thus, if BUFFERCOUNT=3 and BLOCKSIZE=2048, the total number of bytes allocated for buffers is 3*2048, or 6144.
If you do not specify BUFFERCOUNT or you specify zero, the default is 1.
CARRIAGECONTROL = cccc Is a character expression with one of the following values:
'FORTRAN' Process with normal FORTRAN interpretation of the first character 'LIST' Process with single spacing between records 'NONE' Do not use implied carriage control
The default for unformatted files is 'NONE'. The default for formatted files is 'LIST'. However, if you specify the -vms compiler option, and the unit is connected to a terminal, the default is 'FORTRAN'.
CONVERT = fmfm Is a character expression with one of the following options:
'LITTLE_ENDIAN'- Little endian integer data of the appropriate size (INTEGER*1, INTEGER*2, INTEGER*4, or INTEGER*8) and IEEE floating-point data of the appropriate size and type (REAL*4, REAL*8, COMPLEX*8, COMPLEX*16). INTEGER*1 data is the same for little endian and big endian.
'BIG_ENDIAN' - Big endian integer data of the appropriate size (INTEGER*1, INTEGER*2, INTEGER*4, or INTEGER*8) and IEEE floating-point data of the appropriate size and type (REAL*4, REAL*8, COMPLEX*8, COMPLEX*16). INTEGER*1 data is the same for little endian and big endian.
'CRAY' - Big endian integer data of the appropriate size (INTEGER*1, INTEGER*2, INTEGER*4, or INTEGER*8) and CRAY floating-point data of size REAL*8 or COMPLEX*16.
'IBM' - Big endian integer data of the appropriate size (INTEGER*1, INTEGER*2, INTEGER*4, or INTEGER*8) and IBM System\370 floating-point data of size REAL*4 or COMPLEX*8 (IBM short 4) and size REAL*8 or COMPLEX*16 (IBM long 8).
'VAXD' - Little endian integer data of the appropriate size (INTEGER*1, INTEGER*2, INTEGER*4, or INTEGER*8) and Digital VAX floating-point data of format F_floating for size REAL*4 or COMPLEX*8, and D_floating for size REAL*8 or COMPLEX*16.
'VAXG' - Little endian integer data of the appropriate size (INTEGER*1, INTEGER*2, INTEGER*4, or INTEGER*8) and Digital VAX floating-point data of format F_floating for size REAL*4 or COMPLEX*8, and G_floating for size REAL*8 or COMPLEX*16. 'NATIVE' - No data conversion. This is the default.
You can use CONVERT to specify multiple formats in a single program, usually one format for each specified unit number.
When reading a non-native format, the non-native format on disk is converted to native format in memory. If a converted non-native value is outside the range of the native data type, a run-time message appears.
There are other ways to specify numeric format for unformatted files: you can specify a U*X environment variable or the compiler option CONVERT (or OPTIONS/CONVERT). The order of precedence is U*X environment variable, OPEN (CONVERT=), OPTIONS/CONVERT, and then compiler option CONVERT. The CONVERT compiler option and OPTIONS/CONVERT affect all unit numbers used by the program, while environmental variables and OPEN (CONVERT=) affect specific unit numbers.
The following source code shows how to code the OPEN statement to read unformatted CRAY numeric data from unit 15, which might be processed and possibly written in little endian format to unit 20:
OPEN (CONVERT='CRAY', FILE='graph3.dat', FORM='UNFORMATTED', 1 UNIT=15) . . . OPEN (FILE='graph3_native.dat', FORM='UNFORMATTED', UNIT=20)
DEFAULTFILE = cece Is a character expression that specifies a default file pathname (or file specification) string.
This keyword supplies a value to the Fortran I/O system that is prefixed to the FILE keyword parameter.
The default file pathname string is used primarily when accepting file pathnames interactively. File pathnames known to a user program are normally completely specified in the FILE keyword.
If the DEFAULTFILE keyword value does not end in a slash (/), then one is added.
If the DEFAULTFILE keyword is not supplied in the OPEN statement, the Fortran I/O system uses the current working directory.
The following example opens the existing file /usr/users/someone/test.dat:
OPEN (unit=10, DEFAULTFILE='/usr/users/someone/', 1 FILE='test.dat', FORM='FORMATTED', HISTORY='OLD')
DISPOSE = dis or DISP = disdis Is a character expression with one of the following values:
'KEEP' or 'SAVE' Retain the file after the unit is closed. (*DEFAULT FOR ALL BUT SCRATCH FILES*)
'DELETE' Delete the file after the unit is closed. (*DEFAULT FOR SCRATCH FILES*)
'PRINT' Submit the file as a print job and retain it. Use this value only with sequential files.
'PRINT/DELETE' Submit the file as a print job and then delete it. Use this value only with sequential files.
'SUBMIT' Fork a process to execute the file.
'SUBMIT/DELETE' Fork a process to execute the file, and delete the file after the fork is completed.
The disposition specified in a CLOSE statement supersedes the disposition specified in the OPEN statement, except that a file opened as a scratch file cannot be saved, printed, or submitted, nor can a file opened for read-only access be deleted.
ERR = ss Is the label of an executable statement that is to receive control when an error occurs.
ERR applies only to the OPEN statement in which it is specified, and not in subsequent I/O operations on the unit. If an error occurs, no file is opened or created. However, you can use IOSTAT in subsequent I/O statements to perform a similar function.
This keyword is only available on VMS systems.
FILE = flnfln Is a character scalar reference, numeric scalar memory reference, or numeric array name reference.
The FILE parameter specifies the name of the file to be connected to the unit. The name can be any file pathname (or file specification) accepted by the operating system. (See the appropriate manual in your operating system documentation set.)
If the file name is stored in a numeric scalar or array, the name must consist of ASCII characters terminated by an ASCII null character (zero byte). However, if it is stored in a character scalar or array, it must not contain a zero byte.
FORM = ftft Is a character expression with one of the following values:
'FORMATTED' Formatted (*DEFAULT FOR SEQUENTIAL ACCESS*) 'UNFORMATTED' Unformatted (*DEFAULT FOR DIRECT ACCESS*)
This keyword is only available on VMS systems.
IOSTAT = iosios Is an integer scalar memory reference.
If no error exists, ios is defined as zero; if an error exists, ios is defined as a positive integer. IOSTAT applies only to the OPEN statement in which it appears and not to subsequent I/O operations on the logical unit that is opened. However, you can use the IOSTAT parameter in subsequent I/O statements to perform a similar function.
This keyword is only available on VMS systems.
MAXREC = mrmr Is an numeric expression whose value specifies the maximum number of records permitted in a direct access file. The default is an unlimited number of records.
NAME is a nonstandard synonym for FILE. (See FILE.)
This keyword is only available on VMS systems.
ORGANIZATION = orgorg Is a character expression with one of the following values:
'SEQUENTIAL' Records are stored in the order that they are written. Access mode must be sequential, append, or direct (fixed-length records only). (*DEFAULT FOR NEW FILES*)
'RELATIVE' Records are stored in numbered positions. Access mode must be direct or sequential.
'INDEXED' (VMS only) Records are stored according to the values of their keys. Access mode must be indexed or sequential.
The default for an existing file is its current organization.
READONLYProhibits write access to the file. Enables users with read access but not write access to access the file.
The Fortran I/O system's default file access privileges are read-write, which can cause run-time I/O errors if the file protection does not permit write access.
If you wish to read a file for which you do not have write access, you must specify READONLY.
RECL = rlrl Is an numeric expression whose value indicates the length of logical records in a file.
The value of "rl" does not include space for control information, such as for two segment control bytes (if present). The specification is for record data only.
The value of rl is expressed in units of bytes or longwords, depending on the record's format. Formatted records use byte units and unformatted records use "longword" units (which are equal to 4 bytes).
The following table lists the maximum RISC processor values that can be specified for rl, based on record format and CARRIAGECONTROL value.
+--------------+-----------------+----------------------+ | Record Type | CARRIAGECONTROL | Formatted (bytes) | +--------------+-----------------+----------------------+ | FIXED | NONE | 2147483647 (2**31-1) | | | | (Subtract 1 if -vms | | | | is used.) | +--------------+-----------------+----------------------+ | VARIABLE | NONE | 2147483640 (2**31-8) | +--------------+-----------------+----------------------+ | SEGMENTED | NONE | 32764 (2**15-4) | +--------------+-----------------+----------------------+ | STREAM | NONE | 2147483647 (2**31-1) | +--------------+-----------------+----------------------+ | STREAM_CR | LIST | 2147483647 (2**31-1) | | | FORTRAN | 2147483647 (2**31-2) | +--------------+-----------------+----------------------+ | STREAM_LF | LIST | 2147483647 (2**31-1) | | | FORTRAN | 2147483646 (2**31-2) | +--------------+-----------------+----------------------+
The following are the RECL default values:
RECORDTYPE value RECL value ---------------- -----------------------------------------
'FIXED' None; value must be explicitly specified. All other types 132 bytes (for formatted records) 510 longwords (for unformatted records)
The interpretation and effect of the logical record length varies as follows:
- If the file contains segmented records, RECL specifies the maximum length for any segment (including the two segment-control bytes).
- If the file contains fixed-length records, RECL specifies the size of each record.
- If the file contains variable-length records, RECL specifies the maximum length for any record. A fixed-length file with unformatted records must have a record size that is an even multiple of four.
- If your program attempts to write to an existing file a record that is longer than the logical record length, an error occurs.
- Reading a fixed-length file with a record length different from the one used to create the file will produce indeterminate results.
You must specify RECL when you open files with fixed-length records.
RECORDSIZE is the nonstandard synonym for RECL (see RECL).
RECORDTYPE = typtyp Is a character expression with one of the following values:
'FIXED' All records are one size. Short records are padded with blanks (formatted files) or zeros (unformatted files). 'VARIABLE' Records can vary in length. 'SEGMENTED' A record consists of one or more variable length records which may exist in different physical blocks. Valid only for unformatted, sequential files with sequential access. 'STREAM' Data is not grouped into records and contains no control information. 'STREAM_CR' Variable-length records whose length is indicated by carriage-returns embedded in the data. 'STREAM_LF' Variable-length records whose length is indicated by line-feeds (new lines) embedded in the data.
When you open a file, default record types are as follows:
+-------------------------------------+---------------------+ | File Type | Default Record Type | +-------------------------------------+---------------------+ | Direct access sequential files | 'FIXED' | | Formatted sequential access files | 'STREAM_LF' | | Unformatted sequential access files | 'VARIABLE' | | Relative files | 'FIXED' | +-------------------------------------+---------------------+
Within segmented records, a FORTRAN logical record can be greater than 65,535 bytes in length. Only use segmented records for unformatted sequential access to disk or raw magnetic tape files.
In fixed-length record files, if an output statement does not specify a full record, the record is filled with spaces in a formatted file and zeros in an unformatted file.
You cannot use an unformatted READ statement to access an unformatted sequential organization file containing variable-length records, unless you specify the corresponding RECORDTYPE value in your OPEN statement.
Files containing segmented records can be accessed only by unformatted sequential Fortran I/O statements.
This keyword is only available on VMS systems.
STATUS = stasta Is a character expression with one of the following values:
'OLD' Open an existing file 'NEW' Create a new file; if the file already exists an error occurs 'SCRATCH' Create a new file and delete it when the file is closed 'UNKNOWN' Open the file as OLD; if it does not exist, then open the file as NEW
The default is 'UNKNOWN'. This is also the default value if you implicitly open a file using WRITE. However, if you implicitly open a file using READ, the default value is 'OLD'. If you specify the -nof77 compiler option, or OPTIONS /NOF77 the default value is 'NEW'.
Scratch files (STATUS='SCRATCH') are created in the user's working directory and are visible while they are open. When they are closed, they are deleted.
NOTE: The STATUS parameter 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 DISPOSE).
TYPE is a nonstandard synonym for STATUS (see STATUS).
[UNIT=] uu Is a numeric expression that specifies the logical unit to which a file is to be connected.
The unit specification must appear in the parameter list, unless the unit specifier is the first element in the list.
The logical unit may already be connected to a file when an OPEN statement is executed. If this file is not the same as the one to be opened, the OPEN statement executes as if a CLOSE statement had executed just before it.
If the file to be opened is already connected to the unit or if the file specifier (FILE keyword) is not included in the OPEN statement, only the blank specifier (BLANK keyword) can have a value different from the one currently in effect. The position of the file is unaffected.
This keyword is only available on VMS systems.