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

Access an existing RZ file

CALL RZFILE (LUN,CHDIR,CHOPT)

LUN
Logical unit number associated with the RZ file. A call to the routine RZOPEN or a FORTRAN OPEN statement must precede the call to RZFILE.
CHDIR
Character variable specifying the name of the top directory to be associated with unit LUN.
CHOPT
Character variable specifying the selected options.
medium
' '
Disk (default)
mode
' '
Read mode (default)
'S'
Shared mode
'U'
Update mode
'1'
Update mode and only one user (no LOCKs necessary)
'L'
List current LOCK identifiers
'D'
Reset "locking" word of the file (after program crash !)
'C'
Use C I/O
'X'
Exchange format file

Subroutine RZFILE accesses an existing RZ file on the specified logical unit. Should the file not yet exist, the routine RZMAKE should be used.

On return from RZFILE, IQUEST(1)

will be set to 0 if the routine was successful. A non-zero value for IQUEST(1) indicates an error.

N.B. when using option C, the call to RZFILE must immediately follow a call to RZOPEN. This permits the record length of the file to be passed from RZOPEN to RZFILE, where it is stored in an RZ control bank for future use.

CALL RZHOOK (LUN,CHDIR,TARGET,LRECL,CHOPT)

LUN
Logical unit number associated with the RZ file. The RZ file must already be open before calling RZHOOK
CHDIR
Character variable specifying the name of the top directory to be associated with unit LUN.
TARGET
Integer variable containing the address of the user routine that is to be called to perform the I/O. This routine must be declared EXTERNAL in the routine that calls RZHOOK.
LRECL
Integer variable containing the record length of the RZFILE in words.
CHOPT
Character variable specifying the selected options, as for RZFILE.

Subroutine RZHOOK accesses an existing RZ file which must already be connected and ready for I/O. RZHOOK calls the routine RZFILE which reads records from the RZ file.

The specifications for the user I/O routine are the same as for FZHOOK.

An example of a user coded I/O routine

      SUBROUTINE FMXZIO(IBUF,IOWAY)
      DIMENSION IBUF(8192)
+CDE,ZMACH.
+CDE,QUEST.
+CDE,FATBUG.
      CHARACTER*6  CHWAY

      IRC  = 0
      IF(IDEBFA.GE.3) PRINT *,'FMXZIO. IQUEST(1-6) = ',
     +   (IQUEST(J),J=1,6)
      LUN  = IQUEST(1)
      NREC = IQUEST(4)
      IF(IOWAY.EQ.0) THEN
         CALL XZREAD(LUN,IBUF,NREC,IQUEST(2)*IQCHAW,NGOT,' ',IRC)
      ELSEIF(IOWAY.EQ.1) THEN
         CALL XZRITE(LUN,IBUF,NREC,IQUEST(2)*IQCHAW,' ',IRC)
      ELSE
         WRITE(CHWAY,'(I6)') IOWAY
         CALL ZFATAM('Invalid value for IOWAY in FMXZIO - '//CHWAY)
      ENDIF

      IQUEST(1) = IRC

      END



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


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