You can retrieve the query definitions by using the RTVQMQRY command with ALWQRYDFN(*YES). Too bad that no generic
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)