variable length file



Help for IBM's record-oriented filesystem VSAM, ESDS, KSDS, RRDS, LDS and Storage management Subsystems

variable length file

Postby premv12 » Sun Jan 02, 2011 5:02 am

What's the advantage of VB file over FB file and when should one use VB file?
premv12
 
Posts: 7
Joined: Sat Dec 18, 2010 9:52 am
Has thanked: 0 time
Been thanked: 0 time

Re: variable length file

 

Re: variable length file

Postby Robert Sample » Sun Jan 02, 2011 7:06 am

A variable length record can reduce the amount of space required for a file. For example, I had an application one time where we needed to track job history records. The company had some highly mobile employees, so we had to allow for 125 job histories even though the average was less than 5. A fixed length record would have had on average 120+ blank job history records (which were something like 150 bytes each), so using variable length records cut -- literally -- over one billion bytes out of the file space required.

A variable length file should be used when use of one makes sense, or the application specifications state that it should be used. There's no hard and fast rule as to when to use variable length versus fixed length -- each application needs to be considered individually.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: variable length file

Postby steve-myers » Sun Jan 02, 2011 8:32 am

Mr. Sample's summary is excellent. Variable length records may prove to be more difficult to handle in Cobol than fixed length records, but don't let that dissuade you.

Most of my work has been in Assembler, and I use variable length records as a default, fixed length records only where they make a lot of sense, especially if the dataset is going to other programs after being sorted. If I had encountered Mr. Sample's example of a data structure, believe me, I would use variable length records. It takes quite a long time to pass over 1 billion essentially unused bytes in a dataset; better they're not there!
steve-myers
Global moderator
 
Posts: 1885
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Re: variable length file

Postby dick scherrer » Sun Jan 02, 2011 9:58 am

Hello,

Mr. Sample's summary is excellent. Variable length records may prove to be more difficult to handle in Cobol than fixed length records, but don't let that dissuade you.
Definitely.

The 2 "reasons" i find people having difficulty with variable-length data are due to:
. really bad design
. fear/ignorance.

The space savings and i/o reduction can be quite substantial
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: variable length file

Postby premv12 » Sun Jan 02, 2011 11:30 am

Thanks a lot to all of you.
premv12
 
Posts: 7
Joined: Sat Dec 18, 2010 9:52 am
Has thanked: 0 time
Been thanked: 0 time


Return to VSAM/SMS

 


  • Related topics
    Replies
    Views
    Last post