***********************************************************************
*                                                                     *
* Module name: BLOCKTAP                                               *
*                                                                     *
* Syntax: BLOCKTAP ON|OFF|Q|CLOSE <(  SILENCE
*                              <)>>               SILENCE
*                                                                     *
*                                                                     *
* Default Options: TAP1 BLOCK TYPE                             SILENCE
*                                                                     *
* Purpose: Trap TAPEIO calls and change the blocksize to 32k (approx) *
*          This was written expressly to improve the functions of     *
*          VMFPLC2 and TAPE. There are sequences of I/O operations    *
*          which are probably NOT handled correctly by this routine   *
*          but it should work correctly for all sequences generated   *
*          by VMFPLC2 and TAPE.                                       *
*                                                                     *
*          Tapes created withOUT BLOCKTAP will be readable with       *
*          BLOCKTAP ON.                                               *
*                                                                     *
* Author: Steven C. Howes   Brigham Young University                  *
*                                                                     *
* Version: 1                                                          *
*                                                                     *
* Date: 11 May 1987                                                   *
*                                                                     *
* BLOCKTAP ON installs the nucleus extension (unless already          *
* installed) and turns it ON for the specified (or defaulted) device. *
*                                                                     *
* BLOCKTAP OFF turns it OFF for the specified (or defaulted) device   *
* and removes the nucleus extension if no devices are still ON. It    *
* performs the CLOSE and Q functions before extracting itself.        *
*                                                                     *
* BLOCKTAP CLOSE performs any necessary tape operations to insure     *
* that the physical tape reflects the commands which have been        *
* buffered. The buffer is empty after this operation. It performs the *
* Q function after closing.                                           *
*                                                                     *
* BLOCKTAP Q gives statistics for output operations. Included are the *
* number of bytes, gaps and tape marks written. Also, the length of   *
* tape written in feet. (Both virtual (what would have been written   *
* withOUT BLOCKTAP) and real (what was actually written to the tape)  *
* are reported.                                                       *
*                                                                     *
* Option NOBLOCK specifies that the output tape blocksize is NOT to   *
* be altered. This option will optimize tape movement and eliminate   *
* the extra gaps produced by superfluous tape marks and subsequent    *
* re-positioning of the tape.  Tapes created with this option will    *
* be readable withOUT BLOCKTAP.                                       *
*                                                                     *
* Options BLOCK and NOBLOCK may be specified ONLY with the ON         *
* function.                                                           *
*                                                                     *
* Option TYPE specifies that statistics are to be given on the SILENCE
* CLOSE and OFF functions.                                     SILENCE
*                                                              SILENCE
* Option NOTYPE specifies that statistics are NOT to be given  SILENCE
* on the CLOSE and OFF functions. The confirmation messages on SILENCE
* the ON function are also suppressed. This option has NO      SILENCE
* effect on the Q function.                                    SILENCE
*                                                              SILENCE
* The TYPE/NOTYPE setting is preserved for the specified       SILENCE
* device until changed (by specifying the opposite setting).   SILENCE
*                                                              SILENCE
* NO warrantee of ANY kind is either expressed or implied             *
* by the author  or Brigham Young University.                         *
*                                                                     *
* This command installs a Nucleus Extension for the TAPEIO function.  *
* The nucleus extension buffers I/O requests and causes the tape to   *
* be written in standard OS VariableBlocked format. Each record in    *
* this format is one TAPEIO request. A block is written to tape ONLY  *
* when addition of data to it would cause it to exceed 32760 bytes.   *
* It is also written if an ERG, SENSE, REW or RUN command is given.   *
*                                                                     *
* Note that WTM, BSF, FSR and BSR commands are buffered. This saves   *
* tape when the "standard" CMS command sequence of "write the file,   *
* WTM, WTM, BSF, BSF" is issued over and over again... 'cause the     *
* superfluous tape marks are NOT written.                             *
*                                                                     *
* The user must NOT re-position the tape with any CP commands while   *
* BLOCKTAP is ON 'cause the last few commands are probably still in   *
* the buffer and were NOT written to the tape!!!                      *
*                                                                     *
***********************************************************************