+ Reply to Thread
Results 1 to 5 of 5

Thread: how to COMMIT/ROLLBACK directly in RPGLE

  1. #1
    Guest.Visitor Guest

    Default how to COMMIT/ROLLBACK directly in RPGLE

    I use it for testing to see if a GL transaction is ok.
    Code

  2. #2

    Default how to COMMIT/ROLLBACK directly in RPGLE

    Check out the example provided here: href="http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/books_web/c0925076305.htm">Example of how to use commit or Rollback in ILE RPG You might want to read the whole section if you are not familiar with how to get commitment control to work in an RPG program.

  3. #3

    Default how to COMMIT/ROLLBACK directly in RPGLE

    You need to start commitment control, before you're allowed to open a file with COMMIT on F-specs (in RPG III, it was a continuation line with KCOMIT). If you have no need for a CL, other than to start commitment control, call the RPG, then end commitment control, you could declare the file(s) as USROPN, and call QCMDEXC to do the STRCMTCTL end ENDCMTCTL. No matter how you do it, the sequence is: 1)Start commitment control with STRCMTCTL command 2)Open file with COMMIT keyword 3)Issue I/Os, COMMIT, and ROLBK operations 4)Close files with COMMIT keyword 5)End commitment control with ENDCMTCTL command Typically I've seen CL with STRCMTCTL, call RPG, ENDCMTCTL. The RPG has one or more files with COMMIT keyword. The RPG also has its own COMMITs and ROLBKs. It's possible to have the RPG call a 2nd CL to do COMMIT and ROLBK, but I can't think of why you would need to.

  4. #4
    Guest.Visitor Guest

    Default how to COMMIT/ROLLBACK directly in RPGLE

    I guess you could use this:
    Code

  5. #5

    Default how to COMMIT/ROLLBACK directly in RPGLE

    Hello, I looking for an example of how to COMMIT/ROLLBACK directly in RPGLE. All the examples that I see needs a CL. For example: PGM STRCMTCTL LCKLVL(*CHG) CALL PGM(*LIBL/CCTEST2) COMMIT CALL PGM(*LIBL/CCTEST2) ROLLBACK ENDCMTCTL RETURN ENDPGM Is there a way to insert directly in the RPG? (The only way that I see is a PGM that calls a CL that receives a parameter COMMIT or ROLLBACK). Thanks.

+ Reply to Thread

Similar Threads

  1. Invalid update with Commit Control
    By Guest.Visitor in forum RPG
    Replies: 0
    Last Post: 06-17-2004, 06:44 AM
  2. Retrieving COMMIT info about another job
    By Guest.Visitor in forum General
    Replies: 0
    Last Post: 09-22-2003, 10:55 PM
  3. Do as I say.....(Lee Kroons: IBM Execs Commit to Iseries )
    By Guest.Visitor in forum IBM i (OS/400, i5/OS)
    Replies: 0
    Last Post: 10-31-2002, 01:50 PM
  4. Commit control in V5R1
    By gmikos@conestogawood.com in forum IBM i (OS/400, i5/OS)
    Replies: 0
    Last Post: 01-09-2002, 03:30 AM
  5. FTP Directly Into QDLS
    By Guest.Visitor in forum Networking
    Replies: 1
    Last Post: 07-12-2001, 09:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts