next up previous contents index
Next: Disk fileFortran Up: Usage of FZ Previous: Tape fileC

Disk file, Fortran sequential

True exchange-mode disk files cannot be handled with sequential Fortran I/O on several Unix machines. For these machines one should use the D mode, for Fortran direct-access, see the next paragraph.

ALLIANT

For input, open the file and initialize FZ:

      OPEN (Lun, FILE='zname', STATUS='OLD', FORM='UNFORMATTED'
     +,          RECORDTYPE='FIXED', RECL=3600, BLOCKSIZE=3600)

      CALL FZFILE (Lun, 900, 'X')

For output, open the file and initialize FZ:

      OPEN (Lun, FILE='zname', STATUS='UNKNOWN', FORM='UNFORMATTED'
     +,          RECORDTYPE='FIXED', RECL=3600, BLOCKSIZE=3600)

      CALL FZFILE (Lun, 900, 'XO')

CONVEX

For input, open the file and initialize FZ:

      OPEN (Lun, FILE='zname', STATUS='OLD', FORM='UNFORMATTED'
     +,          READONLY
     +,          RECORDTYPE='FIXED', RECL=3600, BLOCKSIZE=3600)

      CALL FZFILE (Lun, 900, 'X')

For output, open the file and initialize FZ:

      OPEN (Lun, FILE='zname', STATUS='UNKNOWN', FORM='UNFORMATTED'
     +,          RECORDTYPE='FIXED', RECL=3600, BLOCKSIZE=3600)

      CALL FZFILE (Lun, 900, 'XO')

IBM MVS, input

If the file is handled with IOPACK on 'unit' 24:

JCL for the file:

//G.IOFILE24 DD DISP=SHR,DSN=gg.uuu.name

Initialize FZ for this file:

      CALL FZFILE  (24, 900, 'XY')

IBM MVS, output

JCL for the file:

//G.IOFILE24 DD DSN=uu.ggg.name,DISP=(NEW,CATLG),
//            DCB=(RECFM=U,BLKSIZE=3600),
//            SPACE=(3600,800,RLSE),UNIT=SYSDA

Initialize FZ for this file:

  CALL FZFILE  (24, 900, 'XYO')

IBM VM/CMS

To handle with Fortran, JCL for the file:

      FI 24 DISK fname ftype fmode (RECFM U LRECL 3600 BLKSIZE 3600 PERM

Initialize FZ for this file:

      CALL FZFILE  (24, 900, 'XF')     for input
 or   CALL FZFILE  (24, 900, 'XFO')    for output

To handle with IOPACK, JCL for the file:

   FILEDEF  IOFILE24 DISK fname ftype fmode (RECFM U BLKSIZE 3600 PERM

Initialize FZ for this file:

      CALL FZFILE  (24, 900, 'XY')     for input
 or   CALL FZFILE  (24, 900, 'XYO')    for output

The file mode of a Zebra exchange file should be 1, thus one might give A1 for the 'fmode' parameter.

VAX VMS, input

Open the file and initialize FZ:

      OPEN (Lun, FILE='zname', STATUS='OLD'
     +,          FORM='UNFORMATTED', READONLY)

      CALL FZFILE (Lun, 900, 'X')

VAX VMS, output

Open the file and initialize FZ:

      OPEN (Lun, FILE='zname', STATUS='NEW', RECORDTYPE='FIXED'
     +,          RECL=900, BLOCKSIZE=3600, FORM='UNFORMATTED')

      CALL FZFILE (Lun, 900, 'XO')

Such a file created on the VAX has these properties:

   VxCrnA$ DIR FZXVAX.DAT.* /FULL

   Directory disk:[uuu]

   FZXVAX.DAT;1                  File ID:  (19177,30,0)
   Size:          240/240        Owner:    [L3_1,uuu]
   Created:  31-MAY-1988 12:03   Revised:  31-MAY-1988 12:11 (2)
   Expires:   <None specified>   Backup:    6-JUN-1988 07:18
   File organization:  Sequential
   File attributes:    Allocation: 240, Extend: 0, Global buffer count: 0
                       No version limit
 ! Record format:      Fixed length 3600 byte records
 ! Record attributes:  None
   Journaling enabled: None
   File protection:    System:RWED, Owner:RWED, Group:RE, World:RE
   Access Cntrl List:  None

Note the parameters marked by '!' on the left margin.

If a file acquired with FTP on a VAX does not have these properties, one could fix this with this little COM file:

      $ SET NOVERIFY     !  RESIZE.COM   900724 12.00
      $ ON ERROR     THEN $ GOTO EXIT
      $ ON CONTROL_Y THEN $ GOTO EXIT
      $!
      $!   COM-file to re-size FTP files
      $!
      $ IF (P1 .EQS. "") THEN
      $   INQUIRE P1 "Enter UNIX file name"
      $   INQUIRE P2 "Enter VMS  file name"
      $   INQUIRE P3 "Give record size in bytes(<CR>=3600)"
      $   IF (P3 .EQS. "") THEN P3 = 3600
      $ OPEN/WRITE OUTP EXCHQZZZ.DAT
      $ WRITE OUTP    "RECORD"
      $ WRITE OUTP    "BLOCK_SPAN              yes"
      $ WRITE OUTP    "CARRIAGE_CONTROL        none"
      $ WRITE OUTP    "FORMAT                  fixed"
      $ WRITE OUTP    "SIZE                    ''P3'"
      $ CLOSE OUTP
      $ EXCHANGE/NETWORK 'P1 'P2 -
              /TRANSFERT=BLOCK -
              /FDL=EXCHQZZZ.DAT
      $EXIT:
      $ DELETE/NOCONF/NOLOG EXCHQZZZ.DAT.*
      $ EXIT


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