TAPE file size in MB.

All sort of Mainframes Interview Questions.
Post Reply
Pragya
Registered Member
Posts: 65
Joined: Wed Jun 19, 2013 9:49 am

TAPE file size in MB.

Post by Pragya »

Hi,

I have been asked a very unusual question for which I hand not had an answer. The question was, how do we calculate the size of TAPE file in MB. I do not know but if I did know what is the use of knowing the file size?

Can someone please answer me on this?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: TAPE file size in MB.

Post by Robert Sample »

Use your tape management system to determine the block size and number of blocks on the tape. Multiply block size by number of blocks, then divide by 1,048,576 to convert to MB. The will give you the approximate size in MB (the last block of the tape may not be a full block, but the calculated value will be the maximum possible size).

The utility of this information is finding out how full the tape is. If the tape will hold 2 GB and your calculation indicates the tape file is 1.8 GB, and you've been asked to add 1 GB of data to that tape, you can be pretty confident that you will need a second tape (due to compression, this is not necessarily true but most likely the file will run into a second tape). The number of tapes becomes important when doing disaster recovery -- every tape written means the tape has to be physically moved to the DR site for the restore. More sites have started using replication to address this issue, but replication can be pretty expensive.
Pragya
Registered Member
Posts: 65
Joined: Wed Jun 19, 2013 9:49 am

Re: TAPE file size in MB.

Post by Pragya »

When the data is compressed on a Tape what happens? For a DASD I understand that, it can be "compress" the data and write to a new block but tape is linear media, how compression happens for that?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: TAPE file size in MB.

Post by Robert Sample »

Tape drives, going back to 1986 and the 3480 IDRC, have supported hardware compression. The tape drive itself compresses the data before it is written to tape and decompresses the data after reading it from tape. Software compression has been available for tape data for some time as well.
When the data is compressed on a Tape what happens? For a DASD I understand that, it can be "compress" the data and write to a new block but tape is linear media, how compression happens for that?
I think you misunderstand compression. The data is compressed in MEMORY, and the data written is ALREADY compressed -- whether for disk data sets or tape files. When the data is read (whether from disk or tape), decompression occurs in MEMORY. A "write to a new block" will not occur, ever -- because that implies the uncompressed data is still part of the data set, and that simply is not true. Every byte of a compressed data set is compressed.
Pragya
Registered Member
Posts: 65
Joined: Wed Jun 19, 2013 9:49 am

Re: TAPE file size in MB.

Post by Pragya »

Thank you so much Robert. But I did not understand that "Data is compressed in MEMORY", what does that mean?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: TAPE file size in MB.

Post by Robert Sample »

Compression is done by the computer on data that is in memory; that is, the current block of data that is to be written to or that was read from the device. Before the data is read, or after the data is written, what is on the device is compressed data.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Interview Questions.”