At 10:09 PM -0500 on 01/08/2011, Gerhard Postpischil wrote about Re: can I dynamically increase tso size:

On 1/8/2011 8:55 PM, Robert A. Rosenberg wrote:
That formula seems to assume RECFM=FB. Since the RECFM is VB,
the formula would seem to me to actually be (Number of
records*40) + File-Size. Since the average file size is 33 bytes
not 5000 bytes, that FB formula yields 70MB (which is also what
my version yields).

No. The formula calculates the worst case space needed. There is no mechanism for telling the file size or average record length, short of actually reading the file an extra time. For a sequential file, the space could be approximated from LSTAR and the device type.

The supplied formula uses the record count as one of its parameters. As you noted, the file size can be computed from LSTAR. There is no need to read the file another time. Just read the file and keep track of how much data you read and end if you run out of space. I agree that you can not compute the average record size for VB unless you have file size and record count. My point was that my formula would give the needed space (which is what will be found to have been used if you attempt to just read and store the file).

With FB, the record count can be approximated by just using the LRECL, BLKSIZE, and LSTAR (you assume no short blocks - Short blocks will just over estimate the record count).

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to