Page 1 of 2

How calculate expected space for VB/V file

PostPosted: Sun Nov 12, 2017 12:57 am
by nikesh_rai
Hi Friends

Please help me to know how to find out expected space that will be taken by a variable length sequential file, when we know the average length and approx. number of records.

I know how to calculate space for fixed length sequential file, but never did for variable length

Thanks
Nikesh Rai

Re: How calculate expected space for VB/V file

PostPosted: Sun Nov 12, 2017 1:19 am
by prino
And what is it that you do not understand? This is so elementary that it should put grave doubts as to your suitability of working in the field you are working in!

How the flipping 'ell would you calculate the space for an FB file with an average length of x bytes???

SIASD!

Re: How calculate expected space for VB/V file

PostPosted: Sun Nov 12, 2017 1:34 am
by nikesh_rai
I am using this formula till now for FB files

391,227 records of FB LRECL=90

INTEGER(27998/90) = 311. Therefor 622 records will fit one track.
391227 / 622 = 628.9823 = 629 tracks required.
629 / 15 = 41.93333 = 42 cylinders required to store your data.

but not sure if anything extra is needed for variable length file

for my case.. my file length is 25000 byte but the program will write at max 10000 byte, I am expecting average file length to be around 6000 byte

Re: How calculate expected space for VB/V file

PostPosted: Sun Nov 12, 2017 4:52 am
by Robert Sample
You can easily find the maximum space required -- add 4 to the record length (for the RDW) and follow EXACTLY the same calculations as for a fixed length data set (the only files in z/OS are on tape or in Unix System Services). If you want to calculate the expected space, add 4 to the average record length and follow EXACTLY the same calculations as for a fixed length data set.

Re: How calculate expected space for VB/V file

PostPosted: Sun Nov 12, 2017 3:59 pm
by nikesh_rai
Thank you Robert. :)

I have one more doubt. While calculating required space. which length I should consider, 1) approx average length of records i.e. around 6000 bytes or 2) Length of longest record which will have 10000 bytes.

I google it but still doubtful on this because of mixed answers.

Re: How calculate expected space for VB/V file

PostPosted: Sun Nov 12, 2017 7:47 pm
by enrico-sorichetti
You did not pay attention :evil:
If you want to calculate the expected space, add 4 to the average record length and follow EXACTLY the same calculations as for a fixed length data set.

Re: How calculate expected space for VB/V file

PostPosted: Sun Nov 12, 2017 10:39 pm
by nikesh_rai
Yes I did.. but was bit confused with answers on google. so wanted to confirm.. :)

Re: How calculate expected space for VB/V file

PostPosted: Sun Nov 12, 2017 10:51 pm
by enrico-sorichetti
so wanted to confirm..

confirm what ???
if You do not trust our replies You have no business hanging around here :evil:

Re: How calculate expected space for VB/V file

PostPosted: Mon Nov 13, 2017 4:14 am
by Robert Sample
If you would rather believe some unknown source from Google over us, WHY DID YOU ASK THE QUESTION IN THE FIRST PLACE?

Since I have over three thousand posts on this forum, why would you think I would lie to you?

Re: How calculate expected space for VB/V file

PostPosted: Mon Nov 13, 2017 7:48 pm
by steve-myers
nikesh_rai wrote:Thank you Robert. :)

I have one more doubt. While calculating required space. which length I should consider, 1) approx average length of records i.e. around 6000 bytes or 2) Length of longest record which will have 10000 bytes.

I google it but still doubtful on this because of mixed answers.

Actually, it's more complex than Prino and others assume.

Knowing the longest record - e.g., the LRECL of the data set, is just about useless.

The fallacy of using the average record length is it is all to easy to figure all the records are the average length. Oops. You have 2 records, one is 10000, and the other is 2000, the average is your 6000, but the physical make up of the data set will not be what you expect.

With variable length records it is critically important to know the BLKSIZE. With BLKSIZE = 10000 and an average record length of 6000 bytes, it is all too likely you'll have blocks with one 6000 byte record. This is not so bad on tape, but it could be critical on disk.

One way to avoid space calculation problems is to use spanned records. Then the BLKSIZE, relative to the record size is less of a factor. The problem with RECFM=VBS is people tend to be afraid of it, especially Assembler programs using BSAM. Then there is the additional CPU cost to assemble the segments. Finally there are other issues with VBS. For example, you can't use DISP=MOD in situations where DISP=MOD would be natural in simple.