ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Qadbxrmtnm

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

  • Qadbxrmtnm

    I have an SQLRPGLE that performs the following stmt
    Code:
    Exec Sql
                 Select Count(*) into :wkCnt from Cusmst
                 where Cmcucd = :OldCode;


    This code is executed in an internally defined sub procedure and the program is compiled as DFTACTGRP(*No)

    when the program ends,a this file and a logical over it are left open

    Code:
     File       Library    Device      Scope       Activation 
     QDUI132    QSYS       QPADEV0002  *ACTGRPDFN  *DFTACTGRP 
     QADBXRMTNM QSYS       QADBXRMTNM  *JOB                   
     CUSMST     GWDATA     CUSMST      *ACTGRPDFN  QILE       
     CUSMSTAG   GWDATA     CUSMSTAG    *ACTGRPDFN  QILE       
     QDUODSPF   QPDA       QPADEV0002  *ACTGRPDFN  *DFTACTGRP 
     QDDSPOF    QSYS       QPADEV0002  *ACTGRPDFN  *DFTACTGRP


    It also leaves a file open named QSYS/QADBXRMTNM

    How can I get the program to close these
    CUSMST and CUSMSTAG at the end abd what is QADBXRMTNM ?

  • #2
    Is there an SQL setting I need to specify to close the files at the end

    Comment


    • #3
      What value for CLOSQLCSR do you have in your options and/or the CRTSQLRPGI command?

      Are you using committment control?

      The default value for CLOSQLCSR is *ENDACTGRP, which might be why you're telling us about your activation group. However, all you've said is that its DFTACTGRP(*NO), so we know you're using an activation group, but we dont know which one. I'm guessing QILE from your open files, though... have you tried reclaiming QILE?

      Comment


      • #4
        Originally posted by Scott Klement View Post
        What value for CLOSQLCSR do you have in your options and/or the CRTSQLRPGI command?

        Are you using committment control?

        The default value for CLOSQLCSR is *ENDACTGRP, which might be why you're telling us about your activation group. However, all you've said is that its DFTACTGRP(*NO), so we know you're using an activation group, but we dont know which one. I'm guessing QILE from your open files, though... have you tried reclaiming QILE?

        I am using the default ENDACTGRP CLOSQLCSR and no commitment control. Yes, it is QILE. Executing RCLACTGRP closes the files adding ACTGRP(*NEW) in the ctl-opt statment does as well

        Comment


        • #5
          That's the way SQL works, since optimization and especially opening the data path (FULL OPEN) is a time consuming process.
          SQL tries to keep the access paths open, so for the next call only the data in the (already opened) ODP (Open Data Path) are updated (PSEUDO OPEN).
          If you specify CLOSQLCSR = *ENDMOD the ODPs get deleted as soon as you end your program/module
          If you use the *NEW activation group in composition with the default of the CLOSQLCSR option, then the ODPs also get deleted at the end of the program.
          For a subsequent call a FULL OPEN must be performed again.
          FULL OPENs are 10-20 times slower than PSEUDO OPENs.
          Just keep that in mind if you change the CLOSQLCSR Option or use the *NEW activation group.

          Comment


          • #6
            Originally posted by B.Hauser View Post
            Just keep that in mind if you change the CLOSQLCSR Option or use the *NEW activation group.
            This program gets called one time and only about once a year. It's not on a menu or anything where it is called over and over so *NEW would probably suffice.

            Thanks for reponding



            Comment


            • #7
              Originally posted by gregwga50 View Post

              Thanks for reponding
              make that responding. I need some more coffee

              Comment

              Working...
              X