Page 1 of 1

Find the size of a PS file (Bytes of data it can hold) without reading

Posted: Thu Jul 06, 2023 6:23 pm
by Vishnupriya
Hi Everyone

I am looking to find the size of a PS file with variable records that are assigned by the user .

The user will create the PS file with certain cylinders and block size. We need to write variable records to that PS file. We want to ensure that we don't blow up the file. So we want to calculate before hand, how much data (bytes of data) it can hold and put a check.

So from the COBOL program, is there a way to find the configuration of the file and then calculate the size or directly find the size of the file ?

Please give some thoughts.

Thank you !

Re: Find the size of a PS file (Bytes of data it can hold) without reading

Posted: Thu Jul 06, 2023 10:07 pm
by Robert Sample
You can ask your question on multiple forums, but the answers won't change that much since the same people answering on one forum usually answer on other forums.

You are approaching the issue from the wrong end. Look for GX26-4577 on the Internet and download a copy of it. This manual gives you, for every given block size, how many blocks will fit per cylinder. Figure out an average record length and that will tell you how many records will fit per block. A simple calculation with the number of cylinders in your data set will tell you approximately how many records will fit in your data set. I say approximately because the exact count depends upon the average record length being accurate.

Topic locked since you have it going on another forum.