Last record Updated at the end of PGM

370 pts.
Tags:
AS/400
PGM
RPG/400
I have Pgm1 which uses file file1 to write some reords to this file.After at the end of PGM1 it is calling PGM2 to read file1 records to update file1 records but here I have a problem last record written by Pgm1 is actually writing to this file at the end of PGM1(after calling PGM2 because of this PGM2 not reading this last record)

Answer Wiki

Thanks. We'll let you know when a new response is added.

USE op code FEOD (Force end of data). Then, to finnaly nail all updates, before going out of the program. SETON LR then RETRN.

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Gilly400
    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.
    23,730 pointsBadges:
    report
  • BigKat
    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
    8,350 pointsBadges:
    report
  • Gilly400
    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.
    23,730 pointsBadges:
    report
  • Alicsc
    I was away from this Discussion.Now I reliaze how Imp your Answers. Thanks to Martin Kevin,
    370 pointsBadges:
    report
  • BigKat
    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.
    8,350 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following