DB2 graphic QMF Version 8

REXX programming example

The following program, DSQABFX, is shipped with QMF.

You can look at the sample source code listing here or you can access it online. For z/OS, the sample program is a member of the library QMF810.SDSQEXCE; for VM, the sample program is on the production disk. REXX is not available in QMF CICS.

The sample program for the REXX callable interface performs the following function:

QMF does not supply query Q1 or form F1, but the sample program uses these objects.

Figure 66. DSQABFX, a sample REXX program
/*REXX***************************************************************/
/* Sample Program:  DSQABFX                                         */
/* REXX Version of the QMF Callable Interface                           */
/********************************************************************/
 
 
/********************************************************************/
/* Start a query interface session                                  */
/********************************************************************/
 
call dsqcix "START (DSQSMODE=INTERACTIVE"
say dsq_message_id dsq_message_text
if dsq_return_code = dsq_severe then exit dsq_return_code
 
/********************************************************************/
/* Set numeric values into query using SET command                  */
/********************************************************************/
 
call dsqcix "SET GLOBAL (MYVAR01=20,SHORT=40,MYVAR03=84"
say dsq_message_id dsq_message_text
if dsq_return_code = dsq_severe then exit dsq_return_code
 
/********************************************************************/
/* Run a Query                                                      */
/********************************************************************/
 
call dsqcix "RUN QUERY Q1"
say dsq_message_id dsq_message_text
if dsq_return_code = dsq_severe then exit dsq_return_code
 
/********************************************************************/
/* Print the results of the query                                   */
/********************************************************************/
 
call dsqcix "PRINT REPORT (FORM=F1)"
say dsq_message_id dsq_message_text
if dsq_return_code = dsq_severe then exit dsq_return_code
 
/********************************************************************/
/* End the query interface session                                  */
/********************************************************************/
 
call dsqcix "EXIT"
say dsq_message_id dsq_message_text
exit dsq_return_code
 


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