next up previous contents index
Next: FZIN - read Up: User specifications for Previous: FZRUN - write

FZOUT - write one data-structure

To write one data-structure:

CALL FZOUT (LUN,IXDIV,!LENTRY,IEVENT,options,IOCH,NUH,IUHEAD)

with    LUN:  logical unit number

      IXDIV:  index of division(s)
               may be zero [or IXSTOR] if the D option is not selected
               may be a compound index if the D option is selected

    !LENTRY:  entry address of the d/s
               may be zero if the Z option is selected

     IEVENT:  start-of-event flag
                 = 0  for event continued
                   1  for new event

               the following values are for use by FZRUN and FZENDO
               and are illegal for calls by the user:
                  13  flush the buffer       15  write end-of-file
                         (X mode only)       16  write end-of-data
                  14  write end-of-run       -1  write start-of-run

    options:  character string,
               individual characters select options:

     select d/s:     mutually exclusive options

                     by default the d/s supported by the bank at
                     LENTRY is written out (link 0 not followed)

                   L write the d/s supported by the linear structure
                     at LENTRY (link 0 followed)

                   M write the banks marked by the user
                     see section~\re{sec:FZmarking} for details

                   D  write complete division(s)
                      default: dead banks are squeezed out
                               (slower but maybe more economic than DI)
                   DI immediate dump of division(s),
                      dead banks, if any, are also written out

                   S write the single bank at LENTRY
                   Z zero banks, ie. empty d/s, header only

         others:   N no links, ie. linkless handling (cf 'Principles')
                     default: links are significant

                   P permit error returns
                     default: exit to ZTELL

       IOCH:   the I/O characteristic for the user header vector; as
               for a bank this may be either 'immediate' if the whole
               vector is of the same type, or it may be composite.

               - immediate:  IOCH = 1  all bits
                                    2  all integers
                                    3  all floating
                                    4  all double precision
                                    5  all Hollerith
                                    7  self-describing

               - composite: set up with

                             CALL MZIOCH (IOCH,NW,'format')  where

                             IOCH is now a vector of NW words at most

        NUH:  number of words in the user header vector, < 401,
              may be zero, in which case IOCH is not used

     IUHEAD:  the user header vector

Write status returned in 265

   IQUEST(1)  =   0 normal completion
                 +1 'pseudo end-of-tape' condition (cf. FZLIMI)
                 -1 first attempt to write after end-of-data
                 -2 error return
   IQUEST(5)  =  word 1 of the direct access adr of the d/s just written
   IQUEST(6)  =  word 2
   IQUEST(9)  =  # of useful machine words ready in the user's memory
                 only for medium 'memory'
   IQUEST(11) =  NWBK, number of words of bank material
   IQUEST(12) =  NWTB, size of the relocation table
   IQUEST(13) =  number of pilot records written so far
   IQUEST(14) =  number of Mwords written so far
   IQUEST(15) =  number of words (up to 1 M) written so far
                 ie. the total is  IQUEST(15) + IQUEST(14)*10**6
   IQUEST(16) =  number of logical records written so far
   IQUEST(17) =  number of physical records written (exchange mode only)
Further information about the file can be obtained by calling FZINFO, see section gif.

Error status returned in 266

Normally FZOUT does not return to the caller for (program) errors, but exits to ZTELL. Exceptionally, error returns may be enabled by the P option.

   IQUEST(1) = -2
   IQUEST(2) = 11: !LENTRY invalid or pointing to a dead bank
             = 12: bank chaining clobbered
             = 13: not enough space for the relocation table
             = 14: medium 'memory': user's memory too small
If the P option is not taken exit is with CALL ZTELL (i,1) with i=11,12,13,14.

If the actual write operation fails, for example because the disk is full, control is handed to ZTELL (which may return) with:

      CALL ZTELL (19,0)
with
      IQUEST(1) = 19
      IQUEST(2) = who is in trouble ?
                    1 - Fortran sequential
                    2 - Fortran direct access
                   21 - L mode sequential
                   22 - L mode direct-access
                   41 - Alfa mode
      IQUEST(3) = IOSTAT error code return by the 'write'
      IQUEST(4) = LUN (Zebra stream identifier)
      IQUEST(5) = C file descriptor if writing in L mode


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