MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

In case VB file rec what will be there in the last byte

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Interview Q & A
View previous topic :: View next topic  
Author Message
rama krishna reddy
Beginner


Joined: 18 Sep 2006
Posts: 31
Topics: 13
Location: Hyderabad

PostPosted: Thu Oct 19, 2006 4:06 am    Post subject: In case VB file rec what will be there in the last byte Reply with quote

Hi,Every one

This is one of the interview quetions
what will be present at teh end of record in case of VB rec
suppose VB record maximum length is 100 byte

first record is 100 bytes lenghth
second record is 60 bytes only at 61 positon is there any delimter ?

can any one explain me about this

Thanks
Rama krishna reddy
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Thu Oct 19, 2006 7:12 am    Post subject: Reply with quote

rama krishna reddy,

Depends on how the data is stored. Most of the time it is spaces or low-values.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dtf
Beginner


Joined: 10 Dec 2004
Posts: 110
Topics: 8
Location: Colorado USA

PostPosted: Thu Oct 19, 2006 11:48 am    Post subject: Reply with quote

I am not really sure what you are asking. The short answer is NO. There would be no delimiter. In a COBOL program you would normally know the record size based upon some identifying field within the record, or there might be an ODO field (Occurs Depending On).

Below, is the long answer:

When reading data in the BUFFER (i.e. the FD in COBOL), what would appear after the logical record just read would be the beginning of the next record. In order to process a variable length record correctly, you would need to use some technique to determine what the size of the record to be processed is.

Obviously if through some error, you process data beyond the end of the logical record, all manner of problems can occur.

In COBOL, the RDW "Record Descriptor Word" is essentially hidden from you. (this is also true of ISPF if you browse a file). Each READ gives you the logical record beginning at the 5th byte of the actual record, bypassing the 4 byte RDW. There are ways of getting at this information, but the circumstance under which you would need to would be somewhat unsual. If you dump a variable length record with IDCAMS or some other utility, or process with other languages, such as assembler, you can actually see the contents of the RDW.

In older versions of COBOL, I have seen a techigue that involved negataive subscripting to get the RDW. With COBOL II, it is possible to code in such a way that the system will provide you with the length of the record.

RDW pertains to QSAM files. In VSAM, the record length is not physically stored with the record. The RDW of a QSAM VB record is 4 bytes long. The first two bytes contain the record length in binary. Because it is two bytes, the largest record length including the RDW is decimal 32,767 (the highest positive number that can be represented in two bytes). At that point, you have a number X'7FFF' as represented in hex, and if you add 1 you'd get X'8000', which is really a negative number because of the way the system interprets the high order bit being turned on.
________
sativa strains


Last edited by dtf on Tue Feb 01, 2011 2:07 pm; edited 1 time in total
Back to top
View user's profile Send private message
rama krishna reddy
Beginner


Joined: 18 Sep 2006
Posts: 31
Topics: 13
Location: Hyderabad

PostPosted: Fri Oct 20, 2006 1:35 am    Post subject: Hi Reply with quote

Thanks a lot for quick response

Thanks
rama krishna reddy
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Interview Q & A All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group