Writing a procedure that sets global variables for the generic query
You can write a procedure that sets global variable values according to REXX logic. These values are then available to the generic query when the procedure issues the QMF RUN QUERY command.
The following procedure uses the SET GLOBAL command to set values for the variables in the query. The results are the same as those explained in Passing variables to the generic query.