Tapes and close to a quarter-century.
Jon maddog Hall
maddog at li.org
Fri Sep 15 15:24:01 EDT 2006
greenmt at gmail.com said:
> Suppose a EBCDIC file on a tape from IBM mainframe is read onto a Linux
> server, and this EBCDIC file on the tape has 100 records with a length of
> 13054, is it correct to estimate the size of the file on Linux server would
> be 1,305,400 bytes?
Generally speaking, yes. Tapes can be both variable length records and variable
length blocks, but often were fixed-length records and fixed-length blocks. If
fixed-length blocks then data size is usually a simple multiplication.
> Is block size information also needed to calculate the size?
A "block" on a magnetic tape is the size of the data between "inter-record gaps".
On a start-stop tape drive this "gap" allowed the tape drive to come to a stop, then
gather speed to read again. There was no useful data in the gap. Usually the block
size was an even multiple of the record size, particularly on fixed length record
tapes.
Typically the larger the blocks, the more likely the block was to have a read error
(particularly in the early days of tapes) and therefore block sizes tended to be
low multiples of record size. Block sizes tended to increase as tape drive mechanisms
and techniques improved. After a while "streaming tape" (tapes with no real
start-stop gaps) took over.
Just because you had a "record" of 13054, does not mean that each record had
13054 useful bytes of data in each one, it depended on what the program put into it.
On the other hand, your record length is sort of an odd record length, so it may be a
real "record" of information.
Usually you can use the 'dd' command to easily read an ibm EBCDIC tape and convert it
to ASCII. Remember that most Unix systems (heck, most systems in general)
use "ASCII", not "EBCDIC", so you might want to convert it, assuming that it is
character data on the tape. But if it is not character data, just "binary" data,
then converting it would be a mistake.
Here is a rough example of what you will need:
dd if=/dev/<tape_drive> of=<file_name> conv=ascii,ibs=13054
The "ibs" in the command line stands for "input block size", and you might try it
both as 13054 and the actual block size of the tape, as I do not remember which
number it relates to. Sorry, but it has been 23 years since I last had to do this.
Regards,
maddog
--
Jon "maddog" Hall
Executive Director Linux International(R)
email: maddog at li.org 80 Amherst St.
Voice: +1.603.672.4557 Amherst, N.H. 03031-3032 U.S.A.
WWW: http://www.li.org
Board Member: Uniforum Association
Board Member Emeritus: USENIX Association (2000-2006)
(R)Linux is a registered trademark of Linus Torvalds in several countries.
(R)Linux International is a registered trademark in the USA used pursuant
to a license from Linux Mark Institute, authorized licensor of Linus
Torvalds, owner of the Linux trademark on a worldwide basis
(R)UNIX is a registered trademark of The Open Group in the USA and other
countries.
More information about the gnhlug-discuss
mailing list