This is a question I am asked enough for me to want to write this so I can direct the askers here. The question is:
How can I discover the files used by all the Query/400 objects in a library?
The Query/400 object is called a Query Definition, and is the following object type: *QRYDFN
To generate a list of the files they use is a two-step process.
The first process is to create an output file that contains the data. I use the Display Program Reference command, DSPPGMREF, to generate the output file. If I wanted to list all the files used by all of the Query definitions in the library MYLIB I would use the following: