The following sample procedure demonstrates how to display, run, and print a report using a query and a form. It also creates a new query based on a table, runs that query, exports the data to a file, and saves the data in a table at a different database server.
SET GLOBAL (TABLE=SMITH.PAYROLL DISPLAY QUERY SMITH.PAYROLL_QUERY RUN QUERY (FORM=SMITH.PAYROLLFORM PRINT REPORT DRAW SMITH.PAYROLLTABLE (TYPE=SELECT RUN QUERY EXPORT DATA TO C:\TEMP\EXP1.IXF (DATAFORMAT=IXF CONNECT TO 'SERVERC' SAVE DATA AS SMITH.DATASAVE SHOW REPORT