next up previous contents index
Next: Create a new Up: Description of user Previous: Description of user

Open a direct access file

CALL RZOPEN (*LUN*,CHDIR*,CHNAME,CHOPT,*LRECL*,ISTAT*)

LUN
Logical unit number associated with the RZ file. The RZOPEN routine issues a FORTRAN OPEN statement for the specified logical unit, unless option C is specified. Option C selects C I/O using the KERNLIB CFIO routines.

If this option is selected, LUN returns the file pointer from the C library I/O routines.

CHDIR
Character variable in which the top directory name is returned (option W). The name has the form `` LUNn'', e.g. `` LUN1'' or `` LUN99'', if FORTRAN I/O is used, or `` LUN1003'' or `` LUN11021'' in the case of C I/O.
CHNAME
Character variable specifying the name of the file to be opened.
CHOPT
Character variable specifying the options required.
' '
default, open file in readonly mode
'L'
create file with relative organization (VAX only)
'N'
open a new file
'S'
open file in shared readonly mode
'U'
open file in update mode
'SU'
open file in shared update mode
'1'
open file read/write assume single user
'W'
return in CHDIR directory name include
'Y'
suppress LRECL consistency check
'C'
Use C I/O instead of FORTRAN I/O
'X'
Exchange mode file
'P'
Preserve case of file name (Unix systems)
LRECL
Integer variable specifying the record length of the file in machine words. If a value of zero (0) is specified, the RZOPEN routine will attempt to obtain the correct record length from the file itself. A value of zero must not be specified for new files.
ISTAT
Integer variable in which the status code is returned.

The RZOPEN routine opens a new or existing RZ file on the specified logical unit. A call to RZFILE, for existing files, or RZMAKE, for new files, must follow a successful call to RZOPEN.

RZOPEN status information returned in IQUEST

IQUEST(10)
Record length (machine words, 32-bit words for exchange mode).
IQUEST(11)
C-file pointer (from CFOPEN).
IQUEST(12)
Exchange mode flag (set if X is specified or is an existing file is in exchange mode).

Operating system dependent features

On Unix systems, filenames are translated to lowercase unless the P option is specified. Lowercase filenames are recommended to avoid problems with mixed or uppercase filenames which might occur, for example with NFS servers.

When accessing RZ files over DECnet, care should be taken to ensure that the RMS network block count is sufficient to process the remote file. The block count is specified in 512 byte blocks.

Accessing a file with record length 4096 words over DECnet

$ SET RMS/NETWORK_BLOCK_COUNT=32

On MVS systems, the prefix for the current userid will be automatically prepended to the filename unless the filename begins with a dot (``.''). For instance, assuming R01jds is the current userid prefix, RZOPEN opens file R01JDS.RZTEST.DATA for both of the following file specifications:

      CHFILE = 'RZTEST.DATA'
      CHFILE = '.R01JDS.RZTEST.DATA'

AFS and NFS specific considerations

C input/output is particularly interesting when accessing Unix files from a VAX/VMS system via NFS. Such files cannot be read by FORTRAN, but can be processed successfully using C. If the file resides on a Unix system, such as an Apollo, Sun etc. the option 'X' should also be specified to indicate that the file is in exchange format by default. Files created on Cray Unicos systems are not, by default, in exchange format.



next up previous contents index
Next: Create a new Up: Description of user Previous: Description of user


Janne Saarela
Mon May 15 08:34:47 METDST 1995