DB2 graphic  QMF Version 8

Writing a procedure that sets global variables for the template query

You can write a procedure that sets global variable values according to REXX logic. These values are then available to the template query when the procedure issues the QMF RUN QUERY command.

The procedure in Figure 167 sets the query variables as global variables. The results are the same as those explained in Passing variables to the template query.

Figure 167. The procedure sets query variables as global variables.
/*  REXX PROC  */
 
IF DATE('W') = 'Friday' THEN
  DO
    "SET GLOBAL (SELECT1 = 'NAME, JOB, SALARY, COMM'"
    "SET GLOBAL (COND1 = '(SALARY > 15000) OR (JOB = 'MGR'')'"
  END
ELSE
  DO
    "SET GLOBAL (SELECT1 = '*'"
    "SET GLOBAL (COND1 = '(DEPT = 51)'"
  END
 
"RUN QUERY SENIORSTAFF"


Go to the previous page Go to the next page

Downloads | Library | Support | Support Policy | Terms of use | Feedback
Copyright IBM Corporation 1982,2004 Copyright IBM Corporation 1982, 2004
timestamp Last updated: March, 2004