To retrieve a query from the database, on the QMF command line enter:
DISPLAY QUERY queryname
The Prompted Query panel displays with the query you requested from the database.