Determine BL and RL of a file

A regular ebcdic mainframe tape usually contains header information the 1st three blocks of the tape. The header information tells the computer/user more information about what is on tape. The header info is 240 bytes in length at 80 bytes each header. The 1st block/header is volume name or volser (usually matches barcode), the next block contains information about the dataset on tape (eg block is 80 bytes and positions 5-21 contain data set identifier-The last 80 block of header information contains information on how the tape is written (80 bytes - Position 5-record format (fixed-or variable), position 6-10 is equal to block length, and positions 11-15 contain record length. I could usually find out the record length and block length of the tape by doing something like dd if=/dev/st0 bs=240 conv=ascii of=/root/header_info.

Think of blocks of data as managing data across the length of the tape and record length where next record of data to be processed or worked with begins....

Sometimes you can figure this out (more frequently if you have an un-labeled tape) by viewing the data on tape in a viewer and as you step thru the tape you determine the tape is fixed (same block size) and can determine the record length by trial and error=look at what you think 1st record ends and then divide by block size-if this is divisible you probably got the correct number...

Now a segy tape has two blocks of data that identify a tape. The 1st block is 3200 length and is usually ebcdic although it can be ascii, the next block is 400, and then comes the data. You can go to www.seg.org and do a search on segy header and it will point you to a document on how the data is put on tape and positions of information about tape (like above). Cannot save and open this document-wants a password-but if you want to view online-just open the word document from your browser....

Anyway I am trying to figure if there is a way to determine the correct block length and record length of a flat file (already on disk-not tape) with some kind of unix-linux script. Here the data would already be on disk-want to be able to format the data correctly if I put on tape. This would be cool and would help me with processing of data-

Thanks in advance-

Bryan

What do you mean by "block"? You don't seem to be talking about a hardware block size... What kind of file is this and why must it be broken up? How are locations relevant to a device like a tape that can't seek? You haven't given us a lot of information yet :slight_smile: