View previous topic :: View next topic
|
Author |
Message |
naren_kang
New User
Joined: 27 Feb 2006 Posts: 3 Location: pune
|
|
|
|
In a cobol program i want to read the length of the VB record before processing it. The first two bytes of a VB file is the length of the record. How do i read first two bytes. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
As far as I can tell, the FM says that "These control fields in the buffer are not available for you to use in your program."
Is there an echo in here? |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Narendar,
If you're still out there, or for posterity:
If you use "VARYING FROM 1 TO your-max-rec-length DEPENDING ON WS-REC-LEN" in the FD, where WS-REC-LEN is PIC 9(004), it will contain the length of the variable rec just read.
If you want to WRITE a rec to a vriable length file do the same thing but MOVE the desired len of the rec to WS-REC-LEN before you issue the WRITE. |
|
Back to top |
|
|
|