RussK1
0 pts. | Jul 25 2005 11:37AM GMT
Per my notes:
RTVQRYF uses MI to retrieve the query definitions and works at security level 30 or below.
HTH
McSick
30 pts. | Jul 26 2005 7:46PM GMT
I have a somewhat archaic way of creating files that contain the file/object references for all Query/400 and Query Manager Queries on our iSeries. Since there is no command to retrieve *QRYDFN or *QMQRY objects’ referenced objects, I had to print all Query/400 and Query Manager Queries to their respective output queues. This is a manual process typing 6 to Print each to the output queue.
You’ll find out with Query/400 you are limited to about 3 pages of 6, before you exceed some threshold. So you cannot do all of them at once like you can with STRQM. I use the DSPOBJD command using *ALL for OBJ and Library, *QRYDFN for OBJTYPE, and *OUTFILE for OUTPUT then write a query using that *OUTFILE to sort them down and summarize to get the unique library names. I do the same for *QMQRY. Then I use WRKQRY and STRQM to begin the most tideous process of typing 6 on each to generate a spooled file. I use CHGJOB command before hand to change to the respetive Output Queues. I wrote two separate CL programs that will combine all spooled files in an output queue to a physical file using the CPYSPLF with *ADD command, one for the *QMQRY and one for the *QRYDFN. In these CLs I create PRTQRYDFN and PRTQMQRY physical files that contain all the spooled files. I then wrote a COBOL program to read these files to retrieve the files/objects that each query uses and write a record for each file/object referenced to files called TEMPQREF and TEMPQMREF. I create similar files for *PGM and *CMD objects as well. I then wrote a command called FNDPGMREF (Find Program Reference) with OBJECT parameter that will display (with a print option) all programs, command, Query/400 and QM Query that reference that particular object be it another file or program object. All of this is written in either COBOL or CL. If you are interested in any of the source let me know. From this FNDPGMREF command I have also read the spooled file it generates to feed a CL to compile or recreate the objects listed. One file was referenced in about 400 programs and I didn’t want to manually recompile them all so wrote a CL program to read the spooled file and submitted each compile to batch. Sweet!
Good Luck!
KeithHodges
0 pts. | Jul 27 2005 10:25PM GMT
iSeries News provided an automated way to do this in December 2003 on p. 51, but I can’t find the article and no longer am a Pro member. It completely automated the process using virtual workstation to update the queries. Go to <a href="http://www.iseriesnetwork.com" title="http://www.iseriesnetwork. " target="_blank">www.iseriesnetwork.com</a> and scan on UPDQRY. Again, you have to be a professional member to see it.
oldtimer4590
0 pts. | Jul 28 2005 4:06AM GMT
Thanks for all your help guys.
Haven’t used this site much in the past but judging from the response I got from you I am going to use it more. Good to get this many replies so quickly.
I’ve been doing RPG for 26 years (I started very young !!)so hopefully I will be able to give something back !!
Thanks once again
TomLiotta
7355 pts. | Oct 30 2009 7:43AM GMT
Don’t feel bad — I’ve been doing RPG since 1973 (and I mean RPG, not RPG II back then; though I went through all the others and I’ve been RPG IV since it showed up).
But I quit Query/400 almost immediately after discovering QM queries back around the late ’80s or early ’90s. I haven’t accepted Query/400 queries in production since then, and I actively discourage their use.even when the SQL Dev Kit is not installed. The advantages simply overwhelm Query/400. (They can be created and used on all AS/400s and later systems regardless of installed LPPs.)
I believe the original RTVQRYF MI program was written by Gary Guthrie. It worked well across many releases of OS/400, but finally started to fade away as OS/400 progressed through version 5. I’m not sure if it can run at all in V6R1.
Jeff Yanoviak rewrote the function RPG IV — RTVQRYF in RPG IV, but your boss doesn’t let RPG IV work in your shop, so…?
Actually, as of V5R4, it can be written entirely in CL. (Are you allowed to compile ILE CL? If so, how is it rational to avoid other ILE languages?)
Automation can be done in a number of ways. Macros for iSeries Access or other emulators, virtual terminal APIs, sockets programming to the telnet server (see Albert York’s TNAPI)…
I’ve had a simple wrapper for RTVQRYF on my web site for years. (I guess it’s time to test it against Jeff Yanoviak’s version and fix any problems.) The wrapper is intended to help process long lists of *QRYDFN objects.
As for your problem, you didn’t say what the problem was, so it’s hard to help. What OS version/release are you running? What security level (QSECURITY) do you have set?
Tom
Sloopy
1940 pts. | Oct 30 2009 1:28PM GMT
I have an alternate for RTVQRYF which will work at all security levels. Please email if you would like the sources.
<a href="mailto:john.blenkinsop@ne.nykline.com" title="mailto:john.blenkinsop@ne.nykline.com">john.blenkinsop at ne.nykline.com</a>
Regards,
Sloopy
TomLiotta
7355 pts. | Nov 21 2009 11:31AM GMT
Corrected — a modified version of Jeff Yanoviak’s RTVQRYF RPG program can be found here. The page text is in French. The MS Translator can help.
The link I posted in my previous post is just a wrapper for RTVQRYF rather than the program itself. The source is still available at the SystemiNetwork site, but it’s one of those ‘VIP Member’ deals. Perhaps worth the membership for this one program.
Tom






