• Aucun résultat trouvé

TAPE2DSK Drive Specifier

Dans le document DOS Corporation (Page 63-67)

The drive=drive-specifier parameter selects one of several tape drives if more than one is connected to the computer. It is not required if only one tape drive is connected. Refer to Chapter 7 for information on selecting drives for TAPESTAR programs.

8.3 Reading Files from Labeled Tape

Labeled tapes have special blocks (labels) which contain information used by the system reading the tape. These labels must be skipped in order to transfer data files correctly. The labels are separated from data files by filemarks, which make the labels themselves short tape files.

One of TAPE2DSK's options, ISF#jiles, specifies a number of files to skip before starting the transfer, allowing any file on a labeled or unlabeled tape to be located.

Even though the three standard labeled tape formats are different, they can be treated identically when used to locate files. The following formula gives the number of tape files to skip in order to transfer data file N (N being 1 for the first file, 2 for the second, etc.):

FILES-TO-SKIP = (N -1) X 3 + 1

To transfer the first data file, skip one file; to transfer the 2nd data file, skip four files, etc.

8.4 Handling Variable Length Blocks

500521 H

Most tapes are written with fixed length blocks; however, two tape formats are currently used in which the block length is variable.

NOTE

The record length for variable length transfers cannot be specified. If the data is in EBCDIC, use the IE option to translate it to ASCII.

Variable length block tapes - This format is not commonly-used. On such a tape, each block is a separate data record and may vary in length. To transfer a file from this kind of tape, use the ITB transfer mode on the TAPE2DSK command line. This will create a separate output record from each tape block read, with appended CRILF delimiter.

mM

variable length tapes - This more common variable length block format has variable length blocks containing control words at the beginning of each block, and at the beginning of each record within the block. These control words identify the length of the following block or record. When working with such a tape, specify the ITI transfer mode on the TAPE2DSK command line. This will read the tape and write each record

8-5

Chapter 8: Using TAPE2DSK.EXE

8-6

in the tape file as a single variable length record (with appended CRILF delimiter) to the disk file.

NOTE

IBM variable length tapes can be spotted by looking at a "hex dump" of several tape blocks. If the blocks are different sizes (not a requirement), and if the value of the hex ''word'' in the first two bytes of the block equals the block length, then the tape is probably written in the IBM variable length fonnat.

8.5 TAPE2DSK Examples

In the following examples, unless otherwise noted, the resulting disk file is always TAPE.DAT, the first (or only) tape drive will be used, and the tape is rewound after the transfer.

1. tape2dsk tape.dat Itr

Transfers the first file on an unlabeled tape.

2. tape2dsk tape.* Itr In

Transfers all files on an unlabeled tape. The resulting disk files are named TAPE.OO1, TAPE.OO2, etc. Does not rewind the tape upon completion (In).

3. tape2dsk tape.dat Itr Isf! Ie

Transfers the second file on an unlabeled tape and translates from EBCDIC to ASCn (unfonnatted disk output).

4. tape2dsk tape.dat Itt Ir80

Transfers the first file on an unlabeled tape, converts fixed length 80-byte records to variable length records and trims spaces at the end.

5. tape2dsk tape.dat Itt Ir80 drive=9t:2

Same as the preceding example, but will read from the second nine-track tape drive.

6. tape2dsk tape.dat Itt Isf! Ir250 Ie

Transfers the first file from a labeled tape, translates to ASCII, converts fixed length 250-byte records to variable length records and trims spaces at the end.

7. tape2dsk tape.dat Itb Isf3

Transfers the fourth file from an unlabeled tape with variable length blocks, making a disk file with variable length records.

8. tape2dsk tape5.dat Itb Isf3 drive=qic:3

Transfers the fourth file from an unlabeled tape with variable length blocks, making a disk file with variable length records. The data will be read from the third QIC drive.

500521 H

500521 H

TAPE2DSK Examples

9. tape2dsk tape5.dat ltv Isf13 Ir120 Ie

Transfers the fifth and sixth files from a labeled tape, translates to ASCII, converts fixed length 120-byte records to variable length records, and does not trim spaces at the end.

8-7

DSK2TAPE copies one or more files from disk to unlabeled tape. It can read both variable length and fixed length file formats, and it always creates tapes with fixed length blocks.

NOTE

DSK2TAPE cannot be used to create labeled tapes. To write a labeled tape, use the TLABEL program described in Chapter 10.

9.1 Determining the Disk Record Format

9.1.1

500521 H

To successfully transfer files using DSK2TAPE, you must first know the following:

1. Does the disk file contain fixed or variable length records?

2. In what character set and format is the disk file written?

3. What character set should be used to create the tape file?

Dans le document DOS Corporation (Page 63-67)

Documents relatifs