Restoring Items from Tape or Floppy Disk

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.

T-LOAD is an INFO/ACCESS command with the same syntax as T-DUMP. Specify the name of the file to which the specified items will be restored. The file is the destination of the operation and the tape is the source of the items to be copied. If an item list is not specified, all items are copied, providing that they do not already exist on file.

To demonstrate T-LOAD, delete a single item from the file, then restore it from tape. The following command deletes one of the items from the ORDERS file on disk drive.

>DELETE ORDERS 10121

'10121' DELETED

In the following example, item '10121' is restored from tape and placed in the ORDERS file.

>T-LOAD ORDERS '10121'

BLOCK SIZE:  16896

 

  1 10121

1 ITEM(S) LOADED

It is important to realize that filename specifies where the item is to be copied. For example:

T-LOAD [DICT] filename [item-list] [selection] [modifiers] [(options)]

This does not identify the file on tape. The tape file is determined by the position of the tape. Thus, T-LOAD searches for the specified data item in the current file on tape. If, for instance, the CUSTOMERS file is specified, the item '10121' is copied from tape to the CUSTOMERS file.

In the previous topic, the example copied the ORDERS file to tape. In this topic, the example restores one of the items from tape. If you removed the tape at the end of the previous topic, you need to replace the tape cartridge in the tape drive.

Type the T-ONLINE command to attach the tape drive and rewind the tape. The tape is now positioned at the beginning of the tape, which is also the beginning of the ORDERS file.

The following example restores from tape all items from the tape file to the ORDERS file. This I option suppresses the listing of item-IDs:

>T-LOAD ORDERS (I)

24 ITEMS LOADED.

The T-LOAD command will not overwrite an item if it already exists on file. Reissuing the same command produces the following result:

>T-LOAD ORDERS '10121'

BLOCK SIZE:  16896

 

'10121' exists on file.

0 ITEM(S) LOADED

The item is not written from tape. If you want the item from tape to overwrite the item on file, use the parenthetical option O with T-LOAD.

When a restoration is finished, the tape is positioned at an EOF mark following the file. To read from the same file on tape, you must reposition the tape back to the beginning of the file. When using a cartridge tape, you must go back to the beginning of the tape and advance forward to the particular position of the file. Because there is only one file on this tape, you only need to rewind the tape to the beginning. Use the T-REW command to rewind the tape.

>T-REW

BLOCK SIZE:  16896

T-REW also reports the current block size. If you are near the system itself, you should be able to hear the tape being rewound.

See Also

Using mvBase Tape Units