RTVQRYF (Back in time)

Tags:
RPG
Hi, I have recently joined a company which hasn't moved on since I was there last in 1990 !!! We still use RPG3 and Query (no ILE or SQL for us) Anyway my question. We need to create a utility which will find all queries that use or write to a file. I have downloaded the RTVQRYF cmd from the internet but have problems getting it to work. Does anybody know if it does work and also is there now a better utility to achive this. Hopefully one day I will persuade my boss to advance technically !!! Thanks in advance for your help

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

We have some queries as well, and when we change our files we have to regen them. This method always works for us.

1. create source PF as srclib/QQMQRYSRC
2. wrkobjpdm over your query library
3. add pdm option (EQ=Extract Query) for RTVQMQRY QMQRY(&L/&N) SRCFILE(QQMQRYSRC) ALWQRYDFN(*ONLY)
4. run the PDM option against all queries.
5. wrkmbrpdm over the srclib/QQMQRYSRC file (these will be SQL source members now).
6. scan or do what you will.
7. if you need to regen them, use this method:

a) wrkmbrpdm, option 25 to scan for the file being changed.
b) on the scan panel, type the file name and in the option field key 5=Browse.
c) add the following macro to client access, and assign it to a key (we use alt-Q)
d) press enter and start pressing alt-Q like you were a madman.
e) note, if it doesn’t work, make sure your wrkqry panel has the library name already keyed; since we only copy-paste the query name from the seu panel.

Description =
[PF10]
[tab word]
[mark right]
[mark right]
[mark right]
[mark right]
[mark right]
[mark right]
[mark right]
[mark right]
[mark right]
[mark right]
[edit-copy]
[PF21]
“wrkqry
[enter]
“2
[edit-paste]
[enter]
[PF3]
[enter]
[PF3]
[PF12]
[enter]

Discuss This Question: 7  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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • RussK1
    Per my notes: RTVQRYF uses MI to retrieve the query definitions and works at security level 30 or below. HTH
    0 pointsBadges:
    report
  • McSick
    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!
    50 pointsBadges:
    report
  • KeithHodges
    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 www.iseriesnetwork.com and scan on UPDQRY. Again, you have to be a professional member to see it.
    0 pointsBadges:
    report
  • Oldtimer4590
    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
    0 pointsBadges:
    report
  • TomLiotta
    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
    125,585 pointsBadges:
    report
  • Sloopy
    I have an alternate for RTVQRYF which will work at all security levels. Please email if you would like the sources. john.blenkinsop@ne.nykline.com Regards, Sloopy
    2,195 pointsBadges:
    report
  • TomLiotta
    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
    125,585 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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following