Joined: 10 Dec 2004 Posts: 110 Topics: 8 Location: Colorado USA
Posted: Thu Oct 19, 2006 11:48 am Post subject:
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
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