ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Capturing Query Exception !!!

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

  • Capturing Query Exception !!!

    Hi Friends,

    I searched all over, i could not find a command/method to retrieve the attributes of the WRKQRY object - *QRYDFN.

    Ok, but there should be a way to capture the exceptions/errors of the run query command. Can anyone help with the command to capture the QRY**** errors in the CL program.

    I tried MONMSG, it is not capturing the query errors.. Quick answer is much appreciated.

    Many thanks,

    Cheers, Vinoth

  • #2
    Re: Capturing Query Exception !!!

    What exception are you monitoring (i.e. MONMSG) for? The same message that appears when it abends?
    Regards

    Kit
    http://www.ecofitonline.com
    DeskfIT - ChangefIT - XrefIT
    ___________________________________
    There are only 3 kinds of people -
    Those that can count and those that can't.

    Comment


    • #3
      Re: Capturing Query Exception !!!

      Originally posted by kitvb1 View Post
      What exception are you monitoring (i.e. MONMSG) for? The same message that appears when it abends?
      Below is the errors message, i am refreshing all the queries in a library. When a query is created with 1.Create attribute instead of 2.Replace for file output, the below error will occur [instance when a result file already exist]. I need to capture and ignore this error in my program. I directly mentinoed QRY5061 in my MONMSG command in my program, but it does not capture this error.

      Message ID . . . . . . : QRY5061 Severity . . . . . . . : 99
      Message type . . . . . : Inquiry
      Date sent . . . . . . : 06/20/12 Time sent . . . . . . : 06:53:40

      Message . . . . : File CFCMPP2012 already exists (I G C).
      Cause . . . . . : The specified output data base file already exists in
      RAJUVINO4.
      Recovery . . . : Type G (go) to replace the file, or type I (ignore) or C
      (cancel) to continue without replacing the file.
      Possible choices for replying to message . . . . . . . . . . . . . . . :

      Comment


      • #4
        Re: Capturing Query Exception !!!

        Post some code please.
        You could also CHGMSGD to default it to your preference.
        Regards

        Kit
        http://www.ecofitonline.com
        DeskfIT - ChangefIT - XrefIT
        ___________________________________
        There are only 3 kinds of people -
        Those that can count and those that can't.

        Comment


        • #5
          Re: Capturing Query Exception !!!

          why not just change the query option to replace the file or replace the member?
          I'm not anti-social, I just don't like people -Tommy Holden

          Comment


          • #6
            Re: Capturing Query Exception !!!

            Originally posted by tomholden View Post
            why not just change the query option to replace the file or replace the member?

            Comment


            • #7
              Re: Capturing Query Exception !!!

              Hey tom !!!

              It's not a solution, we will have instance, where the query will not be created with *replace attribute, [btw, i am running multiple queries in a lib in the same time]

              I need to capture the QRY5061 error in my CL program, its an inquiry message - please let me know how to capture this in the CL.

              Comment


              • #8
                Re: Capturing Query Exception !!!

                Use the search at the top right of this page. Type in RcvMsg. You can use it to loop through all messages sent to the program.
                Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

                Comment

                Working...
                X