You can retrieve the query definitions by using the RTVQMQRY command with ALWQRYDFN(*YES). Too bad that no generic...
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
names are allowed on this command. I have a user-defined option in PDM to retrieve a bunch of definitions into a single source file, and then use the "25" option (fndstrpdm) to search for files, fields etc.
RTVQMQRY QMQRY(qry_library/qry_name) SRCFILE(src_lib/member) ALWQRYDFN(*YES)