How to Run a Query in QMF Automatically

Best example to run SQL query automatically in QMF. Useful for mainframe developers.