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 Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
This topic is locked: you cannot edit posts or make replies. Selecting two copybooks of different ... Vignesh Sid COBOL Programming 8 Tue Sep 05, 2017 7:28 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am
No new posts Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am

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