CL command to compare *QRYDFN files

370 pts.
Tags:
*QRYDFN
CL Commands
IBM iSeries
Is there a CL command like CMPPFM(Compare physical file member) to compare *QRYDFN files. The Process of doing Manual Comparison of *QRYDFN filesĀ is tedious and time consumming. Is there a cl command to simplify this process? Thanks.

Software/Hardware used:
iseries model 820 / OS V5R3MO

Answer Wiki

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

Discuss This Question: 9  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
  • TomLiotta
    Simplest is probably to use CPYFRMQRYF over each OPNQRYF, then compare the resulting files. You might use the NBRRCDS() parameter to limit how many records are copied for simple comparisons. I haven't tried accessing multiple OPNQRYFs since CL allowed multiple file declarations. (Actually, I haven't even done OPNQRYF in a number of years.) You might try it at V5R3. Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    I confused again ... When you say that you want to *QRYDFN files, do you mean the files created by queries or do you mean the *QRYDFN query definitions. If it's files, you can write a query to compare them. If it's the query definitions, that's a horse of a different color. Phil
    50,860 pointsBadges:
    report
  • Yorkshireman
    I interpreted it as being 'we have duplicate queries - which are the same so we can do housekeeping so you need access to the internals. Simple and cheap would be to print the definition and do the CPYSPLF, then CMPPFM - if there are thousands of queries, not impossible - then some programmatic filtering could be needed. finicky and long winded, but not too difficult, and a one off cleanup doesn't need too much elegance. .
    5,580 pointsBadges:
    report
  • danmd5systemad
    Philpl1jb, im simply referring to the plain *QRYDFN query definition. The circumstance im in now is that from my staging library i have to compare a set of *QRYDFN query definition to the working library of the programmer for migration to production. These set of *QRYDFN query definition should match. The process im doing now is to manually compare these set (e.g. 5 query definitions) from my library against the working library of the programmer. i do this manually and it's quite tedious not like when you have a CL command like CMPPFM, its simple and fast. As what Yorkshireman commented below, these are duplicate queries in my staging library which i have to match against the original version residing in the programmer's library. Before migrating this to production, i compare it manually to verify that they are the same because if the programmer did some alteration, this will be a concern and has to be referred to the immediate superior of the programmer. This manual comparison of the query definition is what i want to simplify. I'll try the advice given by Yorkshireman.
    370 pointsBadges:
    report
  • philpl1jb
    I think that Yorkshireman's recommendation will do what you want. 1. print the definitions for 1 library 2. copy each spool file to a physical file or file member 3. repeat for second library 4. use the CMPPFM to compare the two versions of each query Phil
    50,860 pointsBadges:
    report
  • danmd5systemad
    Yup, i just simulated it in our Dev environment and it works, it's a better alternative than doing the manual method. Thanks guys for your expert advices.
    370 pointsBadges:
    report
  • wpoulin
    Dantes, You may want to take a look at Rochester Lab Services Query/400 Discovery Tool. It utilizes the Print_Query_Definition command to pull information from Query/400 definitions and creates database tables that contain such information as which files/tables are being used, join tests, result fields etc. Information on how to obtain the Query/400 Discovery Tool can be found at tinyurl.com/6yjz56q. Hope this helps, Bill Poulin
    2,480 pointsBadges:
    report
  • TomLiotta
    I interpreted it as being As I should have! Sheesh! How I managed to think OPNQRYF from that...? (Where's Emily Litella when you need her?) Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    ...to compare *QRYDFN files. That threw me off the first time around. A *QRYDFN isn't a "file" -- it's a *QRYDFN. *FILE objects are not at all like *QRYDFN objects. A *QRYDFN is a compiled object. It has no data space to 'compare'. Bill Poulin's suggestion for the Query/400 Discovery Tool might be the best choice. I haven't tried it, so I don't know what might be gleaned from it. I do use the Print_Query_Definition, though. I don't recall that it's available at V5R3. But the task might be eased a little by using the RTVQMQRY command. Example:
    RTVQMQRY QMQRY( myqrydfn ) SRCFILE(QQMQRYSRC) ALWQRYDFN(*ONLY)
    That will generate a QM query source member from *QRYDFN compiled object. It can miss a lot of details, but it can also show a lot. If two *QRYDFN objects use different files or different fields, the differences should be obvious. You could compare the resulting source members and only look at ones that seem to be nearly the same. You can also do:
    RTVQMFORM QMFORM( myqrydfn ) SRCFILE(QQMFORMSRC) ALWQRYDFN(*ONLY)
    That provides a source member that describes the print/report layout of the query (in QM form source; not Query/400 source). Two similar QM queries might use two very different print layouts even though they access the same files and fields. Of course, RTVQMQRY and RTVQMFORM also provide basic conversion from Query/400 to QM queries which is better than putting Query/400 queries into production to begin with. This question is one of the many reasons why Query/400 should be discarded. 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