This website has step by step instructions to run this…
Unfortunately, the above link does not provide a reliable list. Files are often chosen at run-time by Query/400 queries. A “model” file is an example where the actual file is overridden at run-time; the model is created temporarily in order to create the query or as a renamed copy of a similar set of files.
And outfiles are most often not specified at creation at all but only named at run-time — they are only rarely captured by the referenced utility.
Field names are even less reliable.
Because of those and other concerns, there simply is no good way to process Query/400 queries to track file/field usage. The information is too often not in the queries.
Conversion to a QM query as in the linked utility loses additional information.
To gather all available information, the *QRYDFN object must be materialized and processed with MI routines or be processed as is done by these programs: One of the few reliable methods uses <a href=”http://www.help400.de/Eng/Freeware.htm”>the RTVQRYF program</a> — scan that link to find the source. It uses ILE RPG to process the result of the USDMPQRY program — also ILE RPG. USDMPQRY is trickier to track down but can be found as an <a href=”http://forums.systeminetwork.com/isnetforums/showthread.php?p=199935″>embedded .zip file in this page</a>.