Link to home
Start Free TrialLog in
Avatar of NNeil
NNeil

asked on

How can I search all of my Query/400 for an instance of a field name?

I am trying to find a query/400 query on my system.  I want to be able to search all of my queries for and instance of a field name.  I can do it on an RPG program but not on queries.  
Avatar of momi_sabag
momi_sabag
Flag of United States of America image

what do you mean by queries?
do you mean static queries?
if you bind your source program into plans, look up in sysstmts
if you use packages, look in syspackstmt
Avatar of NNeil
NNeil

ASKER

I have an AS400 Query/400 queries that I developed and stored in many different query libraries on the AS400.  I would like to search a library for a field name that the query uses.
Minor note... Query/400 is not a DB2 function, though I can understand how you chose to ask here. Better would be:

https://www.experts-exchange.com/OS/AS_-_400/

Even better, I think:

https://www.experts-exchange.com/Programming/System/AS_-_400/

Unfortunately, Query/400 use probably should have been discontinued at least 10 years ago. And since Query/400 queries have essentially no source, there is nothing to actually scan. While there are possibilities, they won't be trivial.

Tom
ASKER CERTIFIED SOLUTION
Avatar of Shalom Carmel
Shalom Carmel
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
One minor note... Shalom has it right. RTVQMQRY is the simplest entry point for the problem. But be aware that it can be misleading in some cases. For example, a field name can appear that is not actually used by the Query/400 object. Unusual, but it happens. A couple other oddities are possible.

As long as it works for your cases, then his answer should get credit. If anything seems incorrect in your results, post back for clarification.

Tom