QRY/400 list of queries

Trying to generate a query list for a library without using DSPOBJD. That method is too slow. In all reality it will be several libraries. I assume the list is stored somewhere for it to come up when you hit F4 in WRKQRY. If it is not stored somewhere then whatever happens when you hit F4 is way faster than doing a DSPOBJD for a library.

Answer Wiki

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

Are you specifying OBJTYPE?

DSPOBJD OBJ(*ALL/*ALL) OBJTYPE(*QRYDFN) only takes a few seconds to run on our system (>66k files in in 116 libraries. only a small percentage of those files are query definitions.)

The first time the DSPOBJD runs, it takes < 10 seconds, after that, it returns very quickly, the DSPOBJD for a single library would probably run very fast.


Generating a “query list” implies DSPOBJD OUTPUT(*OUTFILE). The outfile is full of detail info about each object. The QUSLOBJ (List Objects) API provides an important clue about returning full information about objects: “For performance reasons, you should choose the format that returns only as much information as you need. The higher the number of the format name, the more information is returned and the more time it takes to process.”

There are nine formats in which QUSLOBJ can return info, each one taking longer to fulfill. If you want nothing but a simple list of names, such as WRKQRY can use, a list can be built relatively quickly. The list isn’t built into a database file; that would slow things down. DSPOBJD not only returns most object info; it also writes each item to a database file.

So, if the list as what you need, call the API and request format OBJL0100. Or put up with any delay.


Discuss This Question: 1  Reply

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.
  • astradyne
    You can try looking at the QUSLOBJ system API to generate the list of queries. This API will build a list of objects matching your selection criteria and store the list in a user space. There's an example of how to do this at http://www.code400.com/forum/showthread.php?t=396 If you Google "QUSLOBJ" you should find plenty more examples. Hope it helps Jonathan
    370 pointsBadges:

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.

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


Share this item with your network: