AS/400 CL Unit of Work Question

Tags:
AS/400
RPG
Assuming I am not using any commit control statements and I have a simple CL that executes 2 RPG programs (one after the other); I'll call them step 1 and step 2. Is there a single unit of work that covers both steps or is each step the beginning and ending of a unit of work? That is to say, in this scenario with no commit control or journal commands what happens if step 2 terminates abnormally? Backout to the start of step 2 or backout to the start of step 1? I have not been able to find this info after 2 hours of looking so hope someone can help me?


Software/Hardware used:
AS/400
1

Answer Wiki

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

Given that you aren’t using Commit Control, I’d say you won’t get *any* rollback. At the point step 2 fails, whatever updates it has half-done are now permanent. If you need to ensure that a bunch of updates either complete normally or don’t get applied, well that is exactly what commitment is for.

“Make a commitment to your database.”

Discuss This Question: 3  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.
  • pdraebel
    This all largely depends on what you intend to do, so there will be no clear answer.
    7,545 pointsBadges:
    report
  • Splat
    As step 2 is called after step 1 by your CL program, the process in step 2 is ended at the point of failure.  

    Step 1 would have completed normally in the scenario described & has no direct connection to step 2.
    12,875 pointsBadges:
    report
  • ToddN2000
    When the steps are called independently in the CL they function as two separate jobs. When one finishes and it moves on to job2 you cannot roll back job1 as it completed without error. Your best bet may be to call job2 within job1. This is a guess as we do not have access to the code you are using.
    132,650 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.

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

Following

Share this item with your network: