As far as I know there is no particual API for *QRYDFN meta manipulation.
But - there is a stored procedure called QSYS2.Print_Query_Definition
it will print the query definition, including the printer name, and with some basic SQL you can iterate it and spot the query you need without external tools.
with a reasonably recent IBMi you can even search with a regex thousand of spool files content with a regex just with SQL
here some hints:
https://www.ibm.com/support/pages/extract-information-qrydfn-object-types
ciao
------------------------------
--ft
------------------------------
Original Message:
Sent: Fri February 10, 2023 02:25 PM
From: Sylvain Amyot
Subject: Searching or scanning Queries
Hi I have thousand of query, A lot of them output directly to printers, now my problem is that a printer will be removed and I need to search all query definition to find out the queries that need to be modified. Is there a way to search all queries in a Library like fndstrpdm is used for files.
------------------------------
Sylvain Amyot
------------------------------