next up previous contents index
Next: Structure of the Up: Technical details of Previous: RZ I/O

RZ link area

A permanent reference link area, RZCL, is automatically created upon the first call to RZFILE or RZMAKE. This link area is defined in the patchy sequence P=QCDE,D=QCDE,Z=RCL. This link area contains the following definitions:

LTOP
Address of control bank for current RZ file
LRZ0
Address of bank for memory files
LCDIR
Address of directory structure for current working directory
LRIN
Last record read
LROUT
Last record written
LFREE
Pointer to list of free records
LUSED
Pointer to list of used records
LPURG
Pointer to list of purged records
LTEMP
LCORD
Pointer to list of ordered cycles
LFROM
Pointer to copied directory
LQRS (system link 7) points to a linear chain containing the control banks for all RZ files currently open. A bank for a specific Fortran logical unit or C file pointer can be located using the following code. (The numeric bank identifier is set to the Fortran logical unit or C file pointer).

Locating the RZ control bank by logical unit

*
*     Any RZ files open?
*
      IF(LQRS.EQ.0)GO TO 99
*
*     Yes, loop over linear chain looking for the bank
*     for logical unit LUN
*
      LRZ=LQRS
  10  IF(LRZ.EQ.0)GO TO 99
      IF(IQ(KQSP+LRZ-5).NE.LUN)THEN
         LRZ=LQ(KQSP+LRZ)
         GO TO 10
      ENDIF
*
*     LRZ now points to the control bank for LUN
*     LRECL is equal to # of data words of bank
*
      LRECL = IQ(KQSP+LRZ-1)
*
...
  99  CONTINUE


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