Page 1 of 1

Can we get data after writing in a file.

PostPosted: Tue Jul 29, 2008 12:24 pm
by Ramkumarsony
Usually after writing some data in a file the source(data area defined in the Fild Division FD) will not have the values. if i want to use the datas without using the file(where i wrote the record) what i have to do. I am asking whether there is any way to use that data without accessing the output file. :)

Re: Can we get data after writing in a file.

PostPosted: Tue Jul 29, 2008 4:42 pm
by sachinji84
Hi,
are you asking ,after writing into file. you want to use record area ?

Re: Can we get data after writing in a file.

PostPosted: Wed Jul 30, 2008 12:33 am
by dick scherrer
Hello,

If you want only data from the last record written and you write from working storage, the data for that record will still be in working storage.

If you want data from some previous record or several records, you will not have them available in the program any more.

If i've misunderstood, please clarify.

Re: Can we get data after writing in a file.

PostPosted: Thu Jul 31, 2008 12:14 pm
by Ramkumarsony
Hi sachinji84,
I jus asked cani use the written data without accessing the file where i write. please refer the following code.

WRITE INDATA.
DISPLAY INDATA.

Where INDATA is the data area of a file that i have described it in the file division. When i code like this and during the result in sysout i got only low values(Hex '00') for the "DISPLAY INDATA" instead of written data.

Re: Can we get data after writing in a file.

PostPosted: Thu Jul 31, 2008 12:25 pm
by Ramkumarsony
Thanks D.sch... :) so we cant get the some previously written records except the last one... thanks alot.

Re: Can we get data after writing in a file.

PostPosted: Thu Jul 31, 2008 10:29 pm
by dick scherrer
Hello,

You're welcome, but i believe there is still a bit of misunderstanding.

so we cant get the some previously written records except the last one
You can only get the last one if you used "WRITE FROM" some WS variable. When you use only WRITE, that data is no longer available to the program because the pointer to the i/o buffer has been moved. If you refer to the record-area after the WRITE, the result is unpredictable.

Re: Can we get data after writing in a file.

PostPosted: Fri Aug 01, 2008 5:41 pm
by Ramkumarsony
Ya dick.... Now I understood it correctly.. thank you.... :)

Re: Can we get data after writing in a file.

PostPosted: Fri Aug 01, 2008 6:24 pm
by dick scherrer
You're welcome :)

d