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
How calculate expected space for VB/V file
-
- Posts: 205
- Joined: Tue Oct 18, 2011 1:27 am
- Skillset: IBM Mainframe
- Referer: Internet
How calculate expected space for VB/V file
Thanks
Nikesh Rai
Nikesh Rai
- prino
- Posts: 641
- Joined: Wed Mar 11, 2009 12:22 am
- Skillset: PL/I - CICS - DB2 - IDMS - REXX - JCL, most in excess of three decades
- Referer: Google
- Location: Vilnius, Lithuania
- Contact:
Re: How calculate expected space for VB/V file
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!
How the flipping 'ell would you calculate the space for an FB file with an average length of x bytes???
SIASD!
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
robert.ah.prins @ the.17+Gb.Google thingy
-
- Posts: 205
- Joined: Tue Oct 18, 2011 1:27 am
- Skillset: IBM Mainframe
- Referer: Internet
Re: How calculate expected space for VB/V file
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
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
Thanks
Nikesh Rai
Nikesh Rai
-
- Global moderator
- Posts: 3720
- Joined: Sat Dec 19, 2009 8:32 pm
- Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
- Referer: other forum
- Location: Dubuque, Iowa, USA
Re: How calculate expected space for VB/V file
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.
-
- Posts: 205
- Joined: Tue Oct 18, 2011 1:27 am
- Skillset: IBM Mainframe
- Referer: Internet
Re: How calculate expected space for VB/V file
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.

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.
Thanks
Nikesh Rai
Nikesh Rai
-
- Global moderator
- Posts: 3006
- Joined: Fri Apr 18, 2008 11:25 pm
- Skillset: tso,rexx,assembler,pl/i,storage,mvs,os/390,z/os,
- Referer: www.ibmmainframes.com
Re: How calculate expected space for VB/V file
You did not pay attention

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.
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
-
- Posts: 205
- Joined: Tue Oct 18, 2011 1:27 am
- Skillset: IBM Mainframe
- Referer: Internet
Re: How calculate expected space for VB/V file
Yes I did.. but was bit confused with answers on google. so wanted to confirm.. 

Thanks
Nikesh Rai
Nikesh Rai
-
- Global moderator
- Posts: 3006
- Joined: Fri Apr 18, 2008 11:25 pm
- Skillset: tso,rexx,assembler,pl/i,storage,mvs,os/390,z/os,
- Referer: www.ibmmainframes.com
Re: How calculate expected space for VB/V file
so wanted to confirm..
confirm what ???
if You do not trust our replies You have no business hanging around here

cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
-
- Global moderator
- Posts: 3720
- Joined: Sat Dec 19, 2009 8:32 pm
- Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
- Referer: other forum
- Location: Dubuque, Iowa, USA
Re: How calculate expected space for VB/V file
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?
Since I have over three thousand posts on this forum, why would you think I would lie to you?
-
- Global moderator
- Posts: 2105
- Joined: Thu Jun 03, 2010 6:21 pm
- Skillset: Assembler, JCL, utilities
- Referer: zos.efglobe.com
Re: How calculate expected space for VB/V file
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.
-
- Similar Topics
- Replies
- Views
- Last post
-
-
remove leading special chars, space & trailing special char
by srihemz » Tue Jun 30, 2020 8:06 pm » in DFSORT/ICETOOL/ICEGENER - 2
- 3878
-
by sergeyken
View the latest post
Wed Jul 01, 2020 4:55 pm
-
-
-
EZIOE004 Logical I/O error on file occurred reading VB file
by savitha_y » Mon Feb 15, 2021 7:54 pm » in CA-Easytrieve - 3
- 4970
-
by savitha_y
View the latest post
Wed Feb 17, 2021 5:02 am
-
-
-
File Handling 3 input files and 1 output file by using EZT
by pavan426 » Thu Sep 09, 2021 12:17 am » in CA-Easytrieve - 0
- 4437
-
by pavan426
View the latest post
Thu Sep 09, 2021 12:17 am
-
-
-
Need to check whether file is ESDS file or not by using REXX
by Devrana » Sat Oct 05, 2024 2:28 pm » in CLIST & REXX - 6
- 3297
-
by sergeyken
View the latest post
Tue Oct 08, 2024 5:25 pm
-
-
- 6
- 2527
-
by MFDEV
View the latest post
Fri Sep 11, 2020 9:04 am