Identifying output files in query definitions

65 pts.
Tags:
AS/400 output files
AS/400 Query
Batch files
PRTDFN
RUNQRY
How can one identify all/only output files in a list of query definitions (the list has over 1000 queries in it)? Executing in batch RUNQRY with parameter PRTDFN(*YES), in a loop for each query, then scanning the collective result, might theoretically do the job but doesn't work for queries in which the input files cannot be found (often the case when such files are output files of other procedures/queries).
ASKED: August 25, 2008  4:06 AM
UPDATED: October 2, 2008  9:24 AM

Answer Wiki

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

Hi,

Have you tried ANZQRY? You’d still have to get a loop to process each of the relevant queries.

Regards,

Martin Gilbert.

Discuss This Question: 11  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
  • 221901
    Thank you Martin. ANZQRY does not, however, give me the names of the output files in each query, including libraries, which is what I want. The loop will be done by reading an output file generated by the DSPOBJD command for objects of type QRYDFN. Regards, Rafi (221901)
    65 pointsBadges:
    report
  • Gilly400
    Hi, From the WRKQRY command option 6 prints the query definition to a spooled file - but I don't see any way to get the same print from the command line (RUNQRY runs the query as well and won't work unless the input file exists). If you can find a way to start this option from a command then I think this should work for you. Otherwise you could always use WRKQRY and type 6's next to all your queries (not an ideal solution). Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • 221901
    Using WRKQRY and the print option interactively is exactly what I'm trying to avoid as there are close to 3000 queries to be searched. In any case, thanks for giving this some thought. Rafi
    65 pointsBadges:
    report
  • Sloopy
    See here: http://archive.midrange.com/repository/extqrydef.htm This code will do exactly what you want. Just write a CL to build the object list, and create the output file as described. You can then write a command definition to make it even easier to use. Regards, Sloopy
    2,195 pointsBadges:
    report
  • 221901
    Thank you Sloopy. I will give it a try and, assuming it works, it will be a big help. Rafi
    65 pointsBadges:
    report
  • Sloopy
    You're welcome. I have noticed that it requires your machine to be on a security level LESS THAN 40. :-(
    2,195 pointsBadges:
    report
  • 221901
    How disappointing! -the security level at the company here is indeed 40. I will keep the solution, however, for future reference. Thanks once again.
    65 pointsBadges:
    report
  • Modiyooch
    yeah!!! It worked. Thanks Sloopy. I asked this same question 6 weeks ago and have been struggling with a solution. Now I need to debug the program to see how it works.
    540 pointsBadges:
    report
  • Sloopy
    Yeah, sorry, 221901. It's the same at my place. At least Modiyooch is happy! Insecure, but happy.... I'm going to look at doing this using DMPOBJ to dump the objects I need, and look at the dump output to find the data. It's long-winded, but will work at our enhanced security levels. Regards, Sloopy
    2,195 pointsBadges:
    report
  • 221901
    Will look forward to an update regarding the results of your effort. Thanks once again. Rafi
    65 pointsBadges:
    report
  • Sloopy
    OK. I have a version now that will work with security level 40. I don't have a website, so I will have to give you my email address, thus breaking the unwritten code of the superhero and revealing my true identity. It's better that way than having all of you post your own email addresses here.... If you would like a zip file with the sources, write to me at: john.blenkinsop@ne.nykline.com Regards, Sloopy
    2,195 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