1.2 Can anyone tell me if there is a formula to determine the optimum blocking factor for writing out to tape?

From Jeff Woods:

Blocking factors for tapes depend on the tape drive and format written. For example, on 9-track drives such as the 7980, the inter-record gap and the length of tape used by the data portion of the block varies depending on tape density (1600 or 6250). On DDS drives it's more complex still because of something called a super-block which blocks together multiple data blocks into a single media IO. The super-block mechanism makes the user-specified block less important. I believe MPE limits the maximum blocking factor to 255 records per block. Also, the device drivers for the various tape drives have maximum media block sizes of 16K or 32K. To be compatible with the greatest number of drivers, I recommend coming as close to 16K blocks as possible without exceeding 255 records per block. At the same time, I personally find having blocks with wasted bytes following the last record in the block to be somehow untidy. Therefore, I often will actually round the block size down to find one with an integral number of records in a block evenly. This turns out to be relatively straightforward with a bit of math.

For example, with a record size of 156 bytes:

max block size 16K = 16384 bytes

max 156B records in 16K block = 16384/156 = 105.03 = 105 records per block

wasted bytes at end of block = 16384-(156*105) = 4 bytes

So a blocking factor of 105 would be pretty good, and is probably optimal.

However, to meet my personal peeve, let's see how big a block we can have with no wasted bytes at the end. 156 factors into 2^2*3*13 or 4*39. Looking at a blocksize of 39 sectors:

39*256 = 9984 byte block

blocking factor = 9984/156 = 64 records per block

This would yield almost as good a use of tape space, depending again on the actual media format used, and each block would contain no unused bytes. I would probably use a blocking factor of 64, but other folks would use 105.