Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2008-09-30
5
Medium Priority
?
423 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 33

Accepted Solution

by:
shalomc earned 1500 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

Understanding Linux Permissions

Linux for beginners: How to view the permissions associated with files and directories and also how you can change them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In its Critical Driver Installation Order document, Intel stresses that this sequence be followed:   1       Fresh Operating System Installation 2       Latest Service Pack or Patch 3       Intel® Chipset Software Installation Utility (INF Utili…
I originally wrote this article to compare SARDU and YUMI, but have now added Easy2Boot, since that is the one I currently use and find the easiest to create and alter.
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

719 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