IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

fixed length record and variable length record


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rambabu
Currently Banned

New User


Joined: 18 Apr 2005
Posts: 67

PostPosted: Sat May 28, 2005 6:54 pm
Reply with quote

can any body tell me
what is the diff bettwen fixedlength record and variable length record?which one is best ? what is the uses? in the variable length record 4 bytes it will take length where it will be stored?
Back to top
View user's profile Send private message
vishal_a

New User


Joined: 24 May 2005
Posts: 45
Location: Noida

PostPosted: Sat May 28, 2005 7:07 pm
Reply with quote

Hi rambabu

Fixed length record and variable length records are the two terminology of VSAM files . The KSDS facility contains both fixed length as well as Variable length records . But going a little deeper RDF contains Variable records of 3 bytes each whereas the variable length recods contains 4 bytes each.

thanks regards
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat May 28, 2005 10:32 pm
Reply with quote

Hi rambabu,

Vishal is correct when he says that VSAM recs can be V and F, but flat file recs can also be V and F.

V recs require a 4 byte RDW (Record Descriptor Word) at the beginning of each V rec; F recs do not. V and F recs can be blocked (with 1 or more recs to a block). In this case V recs require a BDW at the beginning of each block; F recs do not.

When V recs are processed by a COBOL pgm the RDW and/or the BDW are not read into the COBOL pgm and only the data portion of the rec(s) should be described (and counted as the rec len) in the pgm.

In the JCL the max LRECL s/b 4 bytes larger than the largest rec expected and the BLKSIZE s/b 4 bytes larger than the block size desired. When determining the BLKSIZE the 4 byte RDW for each contained rec s/b considered.

Here's what a VB block of data might look like:

|BDW|RDW|....data....|RDW|...........data...........|RDW|..data..|

The "|"s, of course, are not part of the rec.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat May 28, 2005 10:53 pm
Reply with quote

Forgot the other part of your ques.

Example:

Suppose you have to report on customer orders. Customers will have a variable # per period, so you might elect to put the order info for each cust into a table and each order for a cust will occupy an entry in their table.

But cust #1 may have 5 orders; cust#2, 15; cust#3, 9; etc. This results in variable length recs.

You could handle this w/fixed length recs, but you'll waste a lot of file space.

You could also say, can't I use a separate rec for each order? But now you must perform an I/O for each order, rather than 1 for each cust. That may be even more expensive.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top