Looking for relevant AS/400 Whitepapers? Visit the Search400.com Research Library.
Gilly400 | Jun 16 2008 8:10AM GMT
Hi,
To be able to use CLOSE you will need to put your file under user control by specifiying UC on your F spec, then you will also need to specify OPEN before using your file and CLOSE before you call your PGM2.
Regards,
Martin Gilbert.
BigKat | Jun 16 2008 1:55PM GMT
Not true Gilly, You can CLOSE a file at any time you want to even if it is AUTOMATICALLY OPENed by the during initialization. All User Control does it prevents the file from being opened automatically.
As far as writing out the last record, you can also code an FEOD to force the data buffer to write out to the file.
Kevin - Affiliated
Gilly400 | Jun 16 2008 2:29PM GMT
Hi BigKat,
Well, you learn something everyday. I’ve always coded UC and OPEN and CLOSE when I needed files closed.
I seem to remember there was also something on the OVRDBF command to force records to write - switches record blocking off - I think it was the SEQONLY parameter?
Regards,
Martin Gilbert.
Alicsc | Jun 16 2008 4:14PM GMT
I was away from this Discussion.Now I reliaze how Imp your Answers.
Thanks to
Martin
Kevin,
BigKat | Jun 17 2008 2:09PM GMT
if you OVRDBF file FRCRATIO(1) you can force the buffer to write after every record is written, but the FEOD is more efficient in this case, as you can buffer the I/O until you are done and then force everything to the file in time for the other program.