Solved

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

Posted on 2008-09-30
5
409 Views
Last Modified: 2013-11-25
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.  
0
Comment
Question by:NNeil
5 Comments
 
LVL 37

Expert Comment

by:momi_sabag
ID: 22607719
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
0
 

Author Comment

by:NNeil
ID: 22607786
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.
0
 
LVL 27

Expert Comment

by:tliotta
ID: 22610110
Minor note... Query/400 is not a DB2 function, though I can understand how you chose to ask here. Better would be:

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

Even better, I think:

http://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
0
 
LVL 32

Accepted Solution

by:
shalomc earned 500 total points
ID: 22613189
it is a pain in the backside, but feasible.

Create a new source file for example YOURLIB/QQRYSRC

Execute the RTVQMQRY command for each and every Query/400 object

If you have PDM, then it is a breeze to create a custom option for this command, to execute if for all *QRYDFN objects, and to search the resulting source members.

If you don't have PDM, well, have fun :p

ShalomC
RTVQMQRY QMQRY(LIBRARY/QRY400NAME) 

         SRCFILE(LIB2/QQRYSRC)      

         ALWQRYDFN(*YES)           

Open in new window

0
 
LVL 27

Expert Comment

by:tliotta
ID: 22617663
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
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

One good source is the manufacturer's web site. Even though the device operating system is changing, the hardware isn't. Going to the support site and looking at the Vista drivers provides a starting point for identifying system hardware for which d…
Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now