Avoid reading uncommitted records in AS400…

25 pts.
Tags:
AS/400 Records
AS/400 Uncommitted Records
is it possible to avoid reading uncommited records in AS400?

Answer Wiki

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

I do not believe your processing program can determine if a record is committed. This is a system function. The records will not commit until you issue the commit command, so you would need to keep track of the records in your code.

————————-
SO this program locked the records .. perhaps changing the records and you want a way to know if they are not yet committed. I think you will have to keep an array of Uncommitted keys and check the records you are reading against the array.

Phil

—————
How about changing PGMA

WRITE FILE-B
WRITE FILE-A
COMMIT

seems way to simple.
Phil

Discuss This Question: 4  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
  • philpl1jb
    Not enough info Uncommitted records are locked and a native I/O read or chain for update would encunter an error -- unless they were locked by this program in this access path. I don't know how a Select for update would act on locked records. So here are some questions - are you attempting to access these records in native I/O? If by native I/O - the same program and the same access path. Phil
    49,720 pointsBadges:
    report
  • As400xyz
    yes...records are accessed through RPG program in INPUT mode i.e: Using opcode READ(N) and same access path.
    25 pointsBadges:
    report
  • As400xyz
    Example:
      PGM-A
    WRITE FILE-A WRITE FILE-B COMMIT
      PGM-B-
    READ FILE-A WRITE FILE-C (FROM FILE-A) There is an error occured while writing in FILE-B. Due to this error PGM-A in message wait(MSGW) after writing a record (Ex: RCD-A) in FILE-A. PGM-B is reading the uncommitted record (RCD-A) from FILE-A and writing into FILE-C. In above scenario, Is there any solution to prevent reading uncommited record (RCD-A) by PGM-B? Note: PGM-A is only maintained by us.
    25 pointsBadges:
    report
  • Splat
    I'm not familiar with the particular problem, but I'd recommend putting the (E) extender on the WRITE operation (e.g.: WRITE(E)), and wrap the whole thing in a MONITOR group.
    7,025 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