Access AS400 Query Print Definitions

50 pts.
Tags:
AS/400 command functions
AS/400 commands
AS/400 printing
WRKQRY
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

Answer Wiki

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

Convert it to sql and store in file. Then search it.. or view the source file. I use this to find fields or specific data inside the queries.. I hate looking at all of them to find what I’m looking for

QSYS/CRTSRCPF FILE(QTEMP/QDDSSRCT)
MONMSG MSGID(CPF0000)

QSYS/RMVM FILE(QTEMP/QDDSSRCT) MBR(*ALL)
MONMSG MSGID(CPF0000)

DSPOBJD OBJ(KEN/*ALL) OBJTYPE(*QRYDFN) +
OUTPUT(*OUTFILE) OUTFILE(QTEMP/QUERYOUT)

QSYS/RTVQMQRY QMQRY(&IN_ODLBNM/&IN_ODOBNM) +
SRCFILE(QTEMP/QDDSSRCT) ALWQRYDFN(*YES)

QSYS/FNDSTRPDM STRING(‘search string’) FILE(QTEMP/QDDSSRCT) +
MBR(*ALL) OPTION(*NONE) PRTMBRLIST(*YES)

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
  • TomLiotta
    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
    125,585 pointsBadges:
    report
  • DanTheDane
    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
    2,555 pointsBadges:
    report
  • MeAndCL
    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
    50 pointsBadges:
    report
  • ISeriesGuyWI
    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.
    80 pointsBadges:
    report
  • TomLiotta
    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
    125,585 pointsBadges:
    report
  • MeAndCL
    ISeriesGuyWI, Yes, I would really like to see that program... it sounds like just what I am looking for. Thank you so much! Ray
    50 pointsBadges:
    report
  • ISeriesGuyWI
    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.
    80 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