Reading/writing IBM 9 track tapes under UNIX

Valdis Kletnieks valdis at wizards.cc.vt.edu
Wed Oct 24 06:55:27 AEST 1990


(Following up to an old article, but hopefully the corrections will help
somebody who has to deal with standard-labeled tapes....)

In article <1990Oct3.205556.16183 at informix.com>, aland at informix.com (alan denney) writes:

|> IBM standard labeled tape files look like this, file-wise:
|> 
|> VOL1    (volume serial label)
|> HDR1    (file header part 1)
|> HDR2    (file header part 2)
   <tapemark> - very important - you see this as an End Of File
|> <data file 1>
   <tapemark>
|> EOF1
   EOF2
   <tapemark>
|> HDR1    (file header part 1)
|> HDR2    (file header part 2)
    <tapemark>
|> <data file 2>
    <tapemark>
|> EOF1
   EOF2
   <tapemark>
|> ...
|> EOV ? (end of tape marker)
   <tapemark>
   <tapemark>

|> You probably need to use files=3 and conv=ascii as well.
|> The record length, block size, and recording format (LRECL,BLKSIZE,
|> RECFM) will appear on the HDR1 file, if you know how to parse it.

Tapemarks are sensed and reported as 'end of file'.

VOL1, HDR2, HDR2, EOF1, EOF2 are all 80-byte physical records.
EOV1 is *only* present if the dataset runs off the end of the physical reel.
End of *logical* reel is denoted by two consecutive tapemarks with no intervening
data...

Note that files=3 will leave you reading the EOF1 and EOF2 records..
The actual *data* is in files 2, 5, 8, 11,....

And be sure you remember the name your system uses for "no auto-rewind" on
tape drives - you'll probably need it... (Nothing like trying to figure out
why you keep reading files, and all you ever get is VOL1/HDR1/HDR2 :-)

					Valdis Kletnieks
					Computer Systems Engineer
					Virginia Tech



More information about the Comp.unix.sysv386 mailing list