next up previous contents index
Next: User marking of Up: User specifications for Previous: Usage for medium

Usage for medium Channel

 

In this mode the records assembled by FZOUT are channelled through a user routine one-by-one to their destination; (rather than being written to a file or to memory). Similiarly for FZIN the data are acquired not from tape or disk directly, but through the same user routine. The name of this routine is not decided by Zebra.

Channelled mode operates with file format 'exchange', ie. the data are collected into fixed-length records, and each record is handed to the user routine when complete (for FZOUT, the inverse for FZIN).

The details of this format are found in chapter gif.

The data format can be 'exchange' or 'native'.

To use this mode the following is necessary:

The connection call is

      EXTERNAL  UserSR
CALL FZHOOK (LUN, UserSR, 0)

passing to FZ the address of the user routine; the third argument is not used for the time being. The specifications for the user routine are:

with   IBUF:  the data of the 'record'

      IOWAY:  the I/O direction:
                = 0  if called from FZIN  for input
                  1  if called from FZOUT for output
                     other values are reserved to the user

     IQUEST
        (1):  on entry: LUN, the stream ID
               on exit:  status flag
        (2):  on entry: the number of machine words for transmission
               on exit:  number of machine words delivered
        (3):  kind of record
        (4):  = zero if sequential access
               = ordinal number of the record wanted if direct-access
        (5):  0 / 1 for disk / tape
        (6):  if FZIN: number of words per physical record

UserSR called from #FZIN>FZIN

In this case IOWAY is zero on entry, and IQUEST(2) specifies the maximum number of words which the buffer IBUF can accept without the program being destroyed.

IQUEST(3) indicates the kind of record expected, if this is zero a normal continuation record is wanted; if it is =1 then FZIN is expecting a physical record starting a new d/s; the user routine is supposed to discard trailing records of the previous d/s if this has been de-selected. Note that selective reading with FZIN in channel mode is not yet fully tuned.

UserSR is supposed to fill the buffer IBUF, store into IQUEST(2) the number of words received, and return zero in IQUEST(1). Exeptions may be signalled by setting

  IQUEST(1) =  -1  end of data
              > 0  error, the value of this status code will be
                   displayed to the caller of FZIN in IQUEST(14)

User routines called from #FZOUT>FZOUT

In this case IOWAY is 1 on entry, and IQUEST(2) specifies the number of words in the buffer IBUF waiting to be transmitted.

UserSR is supposed to dispatch the buffer IBUF, and return zero in IQUEST(1). (At least for the time being, a non-zero status code in IQUEST(1) is ignored.)



next up previous contents index
Next: User marking of Up: User specifications for Previous: Usage for medium


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