
























                                MAG TAPE UTILITY


                       R. E. BURROUGHS    18-AUGUST-1980













                                   CHAPTER 1

                                  INTRODUCTION





     MGT is a PDP-11 program running under RSX to  facilitate  the  reading  and
writing of ASCII mag tapes.  It will allow the user to do the following:



     1.  Position mag tape

         1.  Rewind mag tape

         2.  Skip xxx records (plus or minus)

         3.  Skip xxx files (plus or minus)

         4.  Write an EOV mark at the end of a file


     2.  Write a mag tape

         1.  Disk to tape copy

         2.  Disk to tape blank fill

         3.  Disk to tape blocked (with or without a line terminator)


     3.  Read a mag tape

         1.  Tape to disk copy

         2.  Tape to disk and deblock


INTRODUCTION                                                            PAGE 1-2



         3.  Tape to terminal or line printer


     4.  Tape to tape copy














                                   CHAPTER 2

                               GENERAL OPERATION





     MGT can be initiated in several ways


       >MGT<cr>
       >MGT command line<cr>
       >MGT @command file<cr>




     MGT uses the GCML MACRO with a nesting depth of 2.  Therefore all rules re-
garding indirect command files are applicable.


                              Command line format


                                   OUTFILE/SW=INFILE


     Note that all switches are applied to the output file spec.  The  following
is a summary of recognizable switches.




          /RW        Rewind tape
          /SK:xxx    Skip xxx records
          /SF:xxx    Skip xxx files
          /EV        Write EOV mark


GENERAL OPERATION                                                       PAGE 2-2



          /AL        Copy all files (tape to tape only)
          /BF:xxx    Blank fill records. xxx is record length
          /BL:xxx    Block data to tape. xxx is record length
          /LT:xxx    Use xxx as line terminator for deblocking


     xxx represents an octal number unless followed by a decimal point.  Maximun
record size is 4096..













                                   CHAPTER 3

                              POSITIONING MAG TAPE





     MGT will allow the user to position a mag tape at a given record or file or
at the BOT.  Also, if the tape is at an EOF mark an EOV mark may be written.  In
the case of a /SF or /SK switch, plus or minus values are allowed.


     The following are some examples of the proper use of these switches.

          MGT>MT0:/RW        Rewind MT0
          MGT>MS0:/SK:4      Skip foreward 4 records on MS0
          MGT>MT0:/SF:-6     Skip backward 6 files on MT0
          MGT>MT0:/EV        Write an EOF mark at the current
                             position on MT0. This is an EOV mark if 
                             MT0 is positioned at an EOF mark.



     Note that there is not an input file spec.  associated with these commands.













                                   CHAPTER 4

                               WRITING A MAG TAPE





     Files may be written to mag tape in three different  ways.   The  first  is
just  a  straight copy from disk to tape.  Records of less than 14 bytes will be
padded with nulls.  The second is blank filled records.  Records will be  filled
with  ASCII  blanks.   The  third  is  blocked mode.  Data will be packed into a
buffer until it is filled and then written out to tape.  If a line terminator is
also  given, it will be added to the end of each record read from disk before it
is packed into the buffer.


     The following are some examples of the proper use of  these  switches  when
writting a tape.

          MGT>MT0:=TEST.DAT      The file TEST.DAT will
                                 be copied to MT0.

          MGT>MS0:/BF:132.=TEST.DAT    The file TEST.DAT will
                                 be written to MS0 with each record extended
                                 to 132. bytes and filled with ASCII blanks.

          MGT>MT0:/BL:2000.=TEST.DAT    The file TEST.DAT will be
                                 written to MT0. Each record from TEST.DAT will
                                 be packed into a 2000. byte buffer. When the 
                                 buffer is full it will be written to MT0.

          MGT>MT0:/BL:2000./LT:7=TEST.DAT    This will accomplish the
                                 the same as above, except that the octal no. 7
                                 will be added to the end of each record as it
                                 is packed into the output buffer.
  
  
          MGT>MT0:=TI:                 This will allow a user to write a
                                 a magtape from his terminal.  Records are
                                 terminated by a carriage return and end
                                 of file is signaled by a control/z.













                                   CHAPTER 5

                               READING A MAG TAPE





     There are essintially two ways to read a mag tape.  The  first  is  just  a
straight  copy  from mag tape to disk and the second is to read the mag tape and
deblock it using a given line terminator.  Additionally the output device may be
a teletype or a line printer if the user just wishes to see what is on the tape.


     The following are some examples of reading a mag tape.

          MGT>TEST.DAT=MT0:      The file at the current position of MT0
                                 is copied to the disk file TEST.DAT.

          MGT>TEST.DAT/LT:7=MS0: The file at the current position of MS0
                                 will be copied to the disk file TEST.
                                 DAT. The octal value 7 will be used as 
                                 an end of record mark and will not appear
                                 on the disk file.

          MGT>TEST.DAT/BL:80.=MT0:This is the same as above except that
                                 the file will be deblocked with record
                                 lengths of 80. Care should be used in 
                                 determining the blocking factor. It must
                                 be a multiple of the input record length
                                 or else some data will be lost.

          MGT>LP:=MT0:           The file at the current position of
                                 MT0 will be copied to the line printer.













                                   CHAPTER 6

                               TAPE TO TAPE COPY





     MGT will also allow the user to copy a tape to a tape.  This  is  done  one
file  at a time unless the /AL switch is added.  Then the tape copying will pro-
cede until an EOV mark is encountered.


          MGT>MT0:=MS0:          The file at the current position of
                                 MS0 will be copied to current position of MT0.
          MGT>MT0:/AL=MT1:       All the files on MT1 will be
                                 copied to MT0 untill an EOV mark is
 encountered.

