On Fri, 4 May 2007 08:35:43 -0600, Steve Comstock wrote: >Johnny Luo wrote: >> >> The first is what actually determines the physical blocksize? You told me >> BLKSIZE parm is a maxmimum value for QSAM. So I guess if I write 105 >> records >> to a data set with BLKSIZE=20, I'll get five 20-byte physical blocks and >> one >> 5-byte block(if no padding occurred.) Right?
Blocksize is specified in bytes, but the above description makes sense if you mean that the blocksize is 20 *records*. That is to say, 20 times LRECL. Then you will get five 20-record blocks and one 5-record block > >Logical records are blocked up before being written >from memory to tape or DASD. This is because physical >I/O, the building of the channel program, the scheduling >of an I/O operation, the physical transfer, and handling >the interrupt that says the operation is done - all takes >a lot of time. Perhaps a bigger issue is efficient use of the media. Consider, for example, what happens if you write 80-byte records to a tape without blocking them. Way back in the old days, you might have had an 800 BPI tape drive. Your 80 byte record would occupy about 0.1 inch of tape. This would be followed by about a one inch gap, then the next 0.1 inch of data. Not a very efficient use of the tape. Now, if you block your data to contain 20 records, or 1600 bytes, each block will take about 2 inches of tape with one inch gaps between them. Your 105 record file will be contained on five two inch blocks and one 0.5 inch block, with five one inch gaps between them. Thus, your file occupies about 15.5 inches of tape. The unblocked file would still have the same 10.5 inches of data, but would have 104 inches of gap between the records. (Note that I am ignoring the labels in these examples.) > >... > >Most programmers tend to make block size too small; a block >can be any multiple of record size up to 32K bytes, ... There are historical (hysterical?) reasons for small block sizes, too. Long ago, when you might have only had 120K available for your program and data, you might have had to keep your blocks much smaller. Today, it's usually not a problem. -- Tom Marchant ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

