Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
fixed length record and variable length record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: fixed length record and variable length record
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    Post subject: Re: fixed length record and variable length record
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to Count a particular record in a... Mounika Nemani DFSORT/ICETOOL 5 Tue May 29, 2018 1:07 pm
No new posts How can I convert charactor to fixed ... liying DFSORT/ICETOOL 7 Tue May 22, 2018 3:35 pm
No new posts TRAILER3 is creating blank record in ... kodeesm DFSORT/ICETOOL 3 Fri May 18, 2018 5:45 pm
No new posts VSAM - Accessing beyond record size Benchwarmer JCL & VSAM 6 Wed Apr 11, 2018 9:20 pm
No new posts Limit in Length for a CICS START seahawk789 CICS 6 Mon Apr 02, 2018 8:34 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us