You can retrieve the inside-SQL for each query with a RTV* command (I’ve forgot the exact name, something like rtvqmqrysrc)
You can retrieve last date usage with a DSPOBJD output(*outfile)
You can’t retrieve all the file names that might be in or used by a Query/400 query without some special programming. The file names won’t necessarily be in the source generated from RTVQMQRY. This is just one of the many reasons Query/400 use should have been discontinued some 15 years ago.
See this ITKnowledgeExchange thread on Query/400 files for a helpful aid.