Understanding Tape Command Types

Tape commands are divided into three groups:

Prerequisite

Provides for the orderly sharing of tape devices.

Utility

Sets up the tape drive, or position the tape for various operations.

Production

Allows you to save and restore the system, format and retrieve data, and communicate between machines.

Using Prerequisite Tape Commands

The T-ATT and T-DET commands are prerequisites for the orderly sharing of tape devices. The T-ATT command attaches the tape drive to the user’s process and the T-DET relinquishes control of the tape drive when processing is complete. The system supports multiple tape devices. While only one line can be attached to a device at one time, each line can be attached to multiple devices simultaneously.

NOTE

Multiple devices can be attached to a line from TCL at the same time. Care must be taken to ensure proper management of this feature. Always check to be sure that the correct device is being accessed for any tape operation, and that the device is attached when it is no longer needed.

Using Utility Tape Commands

The utility commands T-ONLINE and T-SELECT allow a process to gain exclusive control of a tape drive. The T-FORMAT command establishes the format used for tape drives, but does not do low-level formatting of diskettes. The status of tape drives can be displayed with T-STATUS.

The utility commands T-FWD, T-EOD, T-REW, and the T-SPACE Proc are used to position the tape. T-WEOF is used to write an EOF mark on tape. T-CHK is used to check tapes for parity errors. Two utility commands, T-READ and T-RDLBL, are available to inspect tapes and may be helpful if any difficulties encountered when using a tape as a storage or transport medium.

Using Production Tape Commands

The production commands fall into four categories:

  1. Performing an account-save or a filesave and restoration.

  2. Reading and writing files using INFO/ACCESS commands.

  3. Reading and writing Spooler print files.

  4. Reading and writing tape records using mvBASIC.

Performing an Account-save or a Filesave and Restore

The commands used to save and restore the system are based on the result of the SAVE command. The ACCOUNT-SAVE Proc and the FILE-SAVE Proc invoke the SAVE command with a specific group of SAVE options.

Data can be retrieved from a SAVE tape by any of the following methods:

The commands used for backing up and restoring the system are covered in other chapters of the mvBase Operation and Administration Guide.

Reading and Writing Files Using INFO/ACCESS Commands

The T-DUMP and T-LOAD commands are INFO/ACCESS commands that are used to write data to and read data from tape. T-DUMP saves data from one file at a time, and is the recommended method of creating tapes for data transfer. T-DUMP allows you to use selection expressions to identify the items that are dumped to tape. It also accepts item lists and processes an active select-list. T-LOAD retrieves data written by T-DUMP and loads it into a specified file, and also accepts selection expressions to identify a set of items to be loaded.

NOTE

The T-DUMP and SAVE commands format the data on the tape in a different manner; thus the data is not interchangeable between those processors.

Reading and Writing Spooler Print Files

Print files can be spooled to tape by assigning the tape drive as the destination for subsequent print jobs (see the SP-ASSIGN and SP-EDIT commands). Print files can be read from tape and output to the printer using the SP-TAPEOUT command, or they can be made into hold files with the HS options of SP-ASSIGN. Use print files to make tapes that are readable by non-mvBase machines, or use SP-TAPEOUT to read files on tape that use carriage returns or line feeds as record delimiters. See the topic on The Spooler for more information on spooling files to tape. Also see the topic at the end of this section on transferring data to non-mvBase systems.

Reading and Writing Print Records Using mvBASIC

READT and WRITET are mvBASIC statements used to read to and write from tapes. These statements assume full control of all blocking and deblocking of tape data records.

Each time the WRITET statement is issued, a new tape block is written. The WRITET statement specifies a string to be placed in the next tape block. If the string does not fill up the tape block, the unused portion is padded with blanks. There are two conditions which produce messages:

  1. If the string is null.

  2. If the length of the string exceeds the size of the tape block.

In the latter case, the string will be truncated to fit in the tape block.

A data record written with the WRITET statement cannot span two blocks. It is efficient therefore to write fixed-length data records and to set the block size equal to the size of the data record or to a multiple of it.

Using INFO/ACCESS Tape Device Commands

Three INFO/ACCESS commands are used with tapes:

T-DUMP and S-DUMP create a tape containing all or selected items from a file or file dictionary.

The T-DUMP command transfers a copy of all or selected file items in random order to tape, and also creates a tape label and writes an End-Of-File (EOF) mark on the tape after the transfer is complete. T-DUMP copies the entire item; you cannot supply any output specification.

The S-DUMP command is a version of T-DUMP that accepts a sort expression (see INFO/ACCESS SORT command).

The T-LOAD command reads all or selected items from a tape and loads them into a file or file dictionary. The T-LOAD command restores file items that were previously copied to tape with either the T-DUMP or S-DUMP commands. These file items can be copied only to an existing file.

See Also

Tape Unit Command Summary

Summary of Tape Device Commands