ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

ENDCMTCTL not allowed. Pending changes active

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ENDCMTCTL not allowed. Pending changes active

    Hi all,

    I have a pgm Xc (is a CL), which look like this:

    PGM Xc
    ------------------------------

    STRCMTCTL LCKLVL(*ALL)

    CALL pgm (VVV)------>RPGLE pgm

    ROLLBACK
    RCLRSC
    ENDCMTCTL
    ---------------------------------

    Pgm Xc is a common pgm, which is also called by pgm Bc (is a CL too)

    However with a new pgm, Dc (is a CL too) which is also calling pgm Xc, i'll have the above mentioned error message.

    At the time i encounter this problem, there is no other pgm locking this file at all. Furthermore this file is a empty. To add to the problem, when i run pgm Bc, there isn't any problem.

    Info: When i call pgm Xc individually there isn't any problem at all.

    Please help, lad and lass out there..

    Thanks

    Regards,
    coins

  • #2
    Re: ENDCMTCTL not allowed. Pending changes active

    Is this all there is to XC ....it looks like you rollback your changes everytime?

    We may also have to see the other CL programs and let us know which files are
    journaled.


    jamie
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Re: ENDCMTCTL not allowed. Pending changes active

      Hi Jammie,

      The pgm Xc only open 1 file, Xfile, which there is 1 "Do" loop in the pgm where it reads all the records in the file Xfile, and update it. If successfully updated than it will commit.

      Thanks for you help lad.

      rgds,
      coins

      Comment


      • #4
        Re: ENDCMTCTL not allowed. Pending changes active

        Its really difficult to guess without seeing all the players but
        Im guessing if no records are updated/changed in one of your programs
        the commit is not being issued.

        This is causing the error.
        Try changing STRCMTCTL to only lock on changes
        STRCMTCTL LCKLVL(*CHG)

        jamie
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment


        • #5
          Re: ENDCMTCTL not allowed. Pending changes active

          thanks lad...

          See maybe I'll do a check on the if i really need to run the pgm Xc in order avoid this problem...

          Will try this out on Monday, have a nice weekend...

          Comment


          • #6
            Re: ENDCMTCTL not allowed. Pending changes active

            Hi jamief,

            I finally found out the problem causing the endcmtctl to abend.

            First of all , i added in a stmt, CLOF(XFile) in pgm Xc, and there is no more abend anymore.. yahoh..... it solved the problem... but i still wandering why the exsting pgm Bc call the comman pgm Xc wont abend while the new pgm Dc call pgm Xc abend?..

            I continue to test out the problem, I check the compilation between program Bc and Dc and i notice pgm Bc is compiled with activation group as *CALLER, while pgm Dc is compiled with activation group *NEW.. so i changed the program Dc to compiled with activation group *CALLER without changing the progam Xc.

            And here it goes... done... solved the problem....

            Thanks jamief.....

            Comment


            • #7
              Re: ENDCMTCTL not allowed. Pending changes active

              Great news glad you got it...sorry I couldnt be of more help.

              jamie
              All my answers were extracted from the "Big Dummy's Guide to the As400"
              and I take no responsibility for any of them.

              www.code400.com

              Comment

              Working...
              X