What program is calling a specific query?

25 pts.
Tags:
AS/400
AS/400 Query
Is there a way to find out what program(s) are using a specific query?
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 9  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.
  • philpl1jb
    I think you would have to search the source .. but that might miss any where the query name comes from a file.
    54,090 pointsBadges:
    report
  • deepu9321
    Are you searching about *QRY object being used in program or Sql Query in Embedded SQL program. 

    However, If you are facing any error, You can find the Program details in Job log. 

    Else, You would need to search in your source library as phil suggested. 
    4,980 pointsBadges:
    report
  • TheRealRaven
    Searching various sources is the best start. Assuming the old *QRYDFN objects, references in source is about the best you can do to find them now.

    To find them as time passes, you might set object auditing with CHGOBJAUD and look for entries in the system audit journal. When a program accesses an audited *QRYDFN object, a ZR (object read) entry will be logged.
    36,420 pointsBadges:
    report
  • TheRealRaven
    ...And if these aren't *QRYDFNs, we need to know what kind of "query" you're asking about. There are many possibilities.
    36,420 pointsBadges:
    report
  • Skungy
    I figured there wasn't and easy way to do this. Okay. Good info here. Thanks everyone for the input.
    25 pointsBadges:
    report
  • Splat
    There's a very easy way to find out.  Delete (or rename) the query.  The program that blows up is your culprit.
    12,915 pointsBadges:
    report
  • Skungy

    I hadn't thought of that Splat but it does make sense. Hmmmm.


    25 pointsBadges:
    report
  • ToddN2000
    I would check the object and see when it was last run. Is this query used often or on occasion or has it become obsolete ? Is this a production query or a user created one? Ask the person who created it where it was set up to run if possible. If no answers are found then I'd scan the source code both RPGLE / CLLE or take Splats suggestion and rename it and see what fails.
    135,485 pointsBadges:
    report
  • TheRealRaven
    ...as long as 'what fails' isn't month-end or payroll or anything important.
    36,420 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: