Using the Test Feature

When developing an SQR program, you frequently test it by running it and examining its output. Often, you are interested only in the first few pages of a report.

To speed up the cycle of running and viewing a few pages, use the -T command-line flag. The -T flag enables reports to finish more quickly because all BEGIN-SELECT ORDER BY clauses are ignored. The database does not sort the data, and the first set of records is selected sooner. Enter the appropriate number of test pages following the -T flag. For example, -T6 causes the program to stop after six pages of output are created.

Note: If the program contains break logic, the breaks can occur in unexpected locations because the ORDER BY clause is ignored.

To test a report file called customer.sqr, enter the following command:

sqr customer username/password -T3

The -T3 flag specifies that the program stops running after three pages are produced.

When the test finishes successfully, check it by displaying the output file on the screen or by printing it. The default name of the output file is the same as the program file with the .LIS extension. For example, if the report is named customer.sqr, then the output file is named customer.lis.

When you finish developing the program, run it without the -T flag. The program processes all ORDER BY clauses and runs to completion. If the program creates more than one report, the -T flag restriction applies only to the first report.