TAP - Universal Magtape Reader ============================== User's Guide ============ TAP is a program to handle magtapes of unknown format, or magtape of a format which FLX and PIP cannot handle. It provides the facility both for listing out information about a tape, and for transferring information from the tape to a file on disk. It also allows for conversion of specified fields (or the whole record) from EBCDIC to ASCII, the truncation of input records to remove trailing blanks. TAP will handle either file-structured or non-file-structured tapes. The command line for TAP is one of the following formats:- 1. TAP TP:/INPSW for getting information or 2. TAP filespec/OUTSW = TP:/INPSW for performing a transfer. where:- TP: is the magtape device name in the format:- MTn: for TU10 or TE10 MMn: for TU16 or TE16 where n is an (optional) single-digit unit number. Filespec is a standard RSX file specification /INPSW represents some combination of input switches. /OUTSW represents some combination of output switches. Valid input switches are:- /LI List on requesting terminal numbered tape blocks with their size in bytes. /FU Same as /LI but also lists out contents of each block, 80 chars to a line. /BL:n:m Specifies that only tape blocks n to m are to be considered. n and m are decimal and must both be specified. /FI:n Specifies that only file n on the tape is to be considered. n is decimal. Note that /BL and /FI are mutually exclusive. Note that TAP considers tape labels to be files when calculating this count. /FX:n:m See Output Switches (4.2) /EB:n1:m1:n2:m2:... Specifies fields on which EBCDIC to ASCII conversion is to be performed. Up to twenty fields may be defined and the parameters are:- n1 (etc.) - Starting byte position of field in record (1-n) m1 (etc.) - Length of field to be converted. These values either apply from the start of each record (if /FX is specified) or from the start of each block. If just /EB is specified, the whole record is converted. /PE Specifies that the device MM: is phase-encoded (TU16 1600 bpi). This switch does not apply to MT: devices and is default for MM:. Valid output switches are:- /AP Indicates that the records are to be appended to an existing output file. /CO Defines the output file to be contiguous. /CR Indicates the output file is to have Carriage Return format (FD.CR set). This is the default. /FX:n:m This switch may be specified either as an input switch or an output switch and indicates that the blocks on tape contain fixed-length records. n represents the length (in bytes) of the records on tape. m if specified, represents the length(in bytes) of the output record. This must be less than or equal to n, and if omitted defaults to n. This is used so that fixed length input records can be truncated before being output to disk (e.g. 80 byte card images truncated to 72 bytes). Note that the /FX switch affects 3 different areas of operation:- (i) It defines each record to be written to the output file. In this case, and this case only, the records are allowed to span block boundaries, so that the whole range of blocks under consideration is considered as one large buffer. (ii) It defines each record to be translated by the /EB switch. In this case, records must fit exactly into the blocks on tape. (iii) It defines the record for the purpose of listing it on the terminal with the /FU switch. In this case records must fit exactly into the blocks on tape. If /FX is not specified, records are assumed to be variable length, and the same length as the tape blocks. /TR Remove all trailing blocks from the output record. This switch may be specified with the /FX switch, in which case the output file is created as variable length with maximum size equal to the record-size. In particular, if the tape contained card images with a sequence number in columns 73 - 80, then /FX:80:72/TR would first strip off the sequence number and then truncate each record. So, for example: TAP MT0:/LI would list, on the terminal, the size of each block on the tape mounted on drive MT0: and TAP OUT.DAT/CO=MT4:/FI:3/FX:80 would create an output file (OUT.DAT) of fixed-length 80 bytes records from the data in the third file on tape. TAP may report the following error messages:- 1. TAP-- COMMAND SYNTAX ERROR The command line did not follow theformat de fined in Chapter 3. 2. TAP-- TAPE PROCESSING ERROR:n An error (type n) occurred while reading the tape. The program exits, tidily closing the output file. This error can occur when the tape contains no recognisable end of tape or end of volume. 3. TAP-- END OF TAPE The program reached the physical end of tape during a read. It closes the output file and exits. 4. TAP-- END OF VOLUME The program reached the logical end of the tape volume during a read. It closes the output file and exits. 5. TAP-- FILE PROCESSING ERROR:n An error (type n) occurred when trying to create the output file. This would probably be something like Privilege Violation, no UFD, etc. The program exits. 6. TAP-- RECORD PROCESSING ERROR:n An error (type n) occurred when trying to write a record to the output file. This would probably be something like Allocation Failure. The program closes the output file and exits. TAP - Universal Magtape Reader ============================== System Guide ============ TAP consists of a single module. This first gets the command line from MCR and parses it to see what action is required. It also checks that conflicting switches have not been specified. If an output file was specified it opens the file with the required attributes. It then attaches to the tape unit, resets any characteristics, if necessary, and rewinds the tape. It then reads through the tape (if necessary) until the first block or file specified is reached. It then reads each block in the range specified, and for each one does any EBCDIC/ASCII conversion that is required. If only a listing was requested, it outputs the block number and length and (if required) the contents of the block/records. If a file transfer was requested, it copies the data to the output file, performing any truncation/deblocking as needed. Note that for file transfer, fixed-length records may span block boundaries (as long as they are either all-EBCDIC or contain no EBCDIC for conversion). The program is built using the command file TAP.CMD. It is a standard non-privileged task, with 4 units (of which unit 1 should be assigned to TI:) and a taskname of ...TAP.