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

This Forum is for the guests or the users who are not registered on this board. This part allows guests to post in.
Vishnupriya

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

Post 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 !
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

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

Post 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.
Locked

Return to “You are a Guest.”