I need to generate a report that shows the output type and the name of the output device found in the print definitions of a designated query. Since there are a lot of queries to check, I need to get access to the query print definitions without using WRKQRY option 6. I would be happy if there is an existing AS400 command or procedure that does exactly what WRKQRY option 6 does, so that I can check all queries in a designated library.
Software/Hardware used:
AS400 I-Series
ASKED:
April 19, 2011 4:53 PM
UPDATED:
May 2, 2011 11:05 PM
I would be happy if there is an existing AS400 command or procedure that does exactly what WRKQRY option 6 does…
The only such command is WRKQRY with its option 6. That’s it. No more.
Technically, you could create an emulator macro that did WRKQRY option 6 for every query in a library. If you did that for a fresh emulator session, at least all of the spooled files would be in a single job.
Tom
Have you tried to use cmd DMPOBJ and study the print ?
I have hard times to understand why you need this info, – pls tell us.
If your task is to control which printers are to be used, you may create a cl-pgm with OVRPRTF and RUNQRY with parameters in it.
.. still puzzles me what you want to obtain…
DanF
Tom,
Thanks for your response. I will look into the emulator macro that you suggested. In the meantime, the operator is performing the WRKQRY option 6 to create the spool file that has the print definitions. These spool files are sent to a designated outq, and my CL procedure takes over from there, by extracting the needed info from the spool files. For the operator’s sake, I was hoping to make this all a one-step process.
Thanks again.
Ray
I have a program that I created a few years back that gets the info out of a query like input files, output files, summary/detail and printer. I can send it to you if you like. It’s only 350 lines long but does a great job at collecting that info.
The DMPOBJ option can work. It might take some experimentation with a query to see what changes when a printer reference is changed.
ISeriesGuyWI might have a solution for you. I’m aware of two different methods for retrieving the info, depending on what version/release your OS is at (and what security is set for your system.) Programming generally either uses MI functions to resolve elements of the *QRYDFN object or dumps the object and harvests the spooled output.
I might code a basic CL to run WRKQRY over a list of the objects. Then I’d have a macro that responded as each one was displayed to navigate to the printer reference. Once there, you might have the macro move to the printer name, copy the name and execute SNDMSG to a message queue. Just a little creative macro work could give you everything in a single location. There’s actually a lot of useful intelligence that can be put in (with some practice).
Tom
ISeriesGuyWI,
Yes, I would really like to see that program… it sounds like just what I am looking for.
Thank you so much!
Ray
Ray, send me an email to jforss@wincraft.com and I will send it to you. If you are going to COMMON in Minneapolis I can give it to you there.