Page 1 of 1

VB file, what will be there in the last byte?

Posted: Tue Aug 12, 2014 12:42 pm
by Dark Fantasy
Hi,Every one

The interviewer asked that, "what will be present at the end of record in case of VB record. Assuming VB record's maximum length is 100 byte and first record is 100 bytes long while the second record is 60 bytes. At 61 positon will there be any delimter ?

I could nto answer this question. Can someone please help.

Re: VB file, what will be there in the last byte?

Posted: Tue Aug 12, 2014 3:40 pm
by William Collins
The last byte of the record will contain the last byte of your data. There is no byte after the last byte of data. There's an end-of-file marker, but you'll never see it.

Re: VB file, what will be there in the last byte?

Posted: Tue Aug 12, 2014 6:35 pm
by Robert Sample
VB records have a 4-byte PREFIX (called the Record Descriptor Word or RDW) which has 2 bytes for the length and X'0000' for the other 2 bytes. There is nothing special about the last byte of a record. For your example, the data set would contain a 4-byte BDW (Block Descriptor Word), a 4-byte RDW, 100 bytes of data, another 4-byte RDW, and 60 bytes of data (assuming the block size is big enough to hold 2 or more records).