View previous topic :: View next topic
|
Author |
Message |
raghavendra_p_sarvade
New User
Joined: 17 Oct 2006 Posts: 32
|
|
|
|
Hi,
FD WS-FILE.
01 WS-RECORD.
When I do a WRITE WS-RECORD, I expect the WS-RECORD to retain the values after the write.
But I get the WS-RECORD as initialized to spaces in my program though the file has the record with data. The file status was 0. This is a simple flat file.
Is there a reason this could happen?
Thanks,
Raghav |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
I vaguely remember the following scenario :
WS-RECORD is part of an internal buffer.
The physical write will occur if the buffer is filled.
Before the buffer is filled the internal buffer pointer
is updated to point to the next record in the buffer. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
This is the expected behavior. If you click the manuals link at the top of the page, bring up the COBOL Language Reference manual, and look at the WRITE statement syntax, you will find that
Code: |
WRITE record FROM data-area |
specifically does not affect the data-area fields. However, record is part of the buffers associated with the file and record data written will not be available after the WRITE statement is done. This is normal, expected, and cannot be changed by any COBOL option or facility. |
|
Back to top |
|
|
|