|Oracle9i OLAP Services Developer's Guide to the OLAP DML
Release 1 (9.0.1)
Part Number A86720-01
Designing Programs, 13 of 13
Even when your program compiles cleanly, you must also test the program by running it. Running a program helps you detect errors in commands with ampersand substitution, errors in logic, and errors in any nested programs.
To test a program by running it, use a full set of test data that is typical of the data that the program will process. To confirm that you test all the features of the program, including error-handling mechanisms, run the program several times, using different data and responses. Use test data that:
Each time you run the program, confirm that the program executes its commands in the correct sequence and that the output is correct. As an aid in analyzing the execution of your program, you can include SHOW commands in the program to produce diagnostic or status messages. Then delete the SHOW commands after your tests are complete.
When you detect or suspect an error in your program or a nested program, you can track down the error by using the debugging techniques that are described in the next section.
For the syntax of the SHOW command, see the entry for the command in OLAP DML Reference.
When you set the BADLINE option to YES, additional information will be produced, along with any error message when a bad line of code is encountered. When the error occurs, the error message, the name of the program, and the program line that triggered the error are sent to the current outfile.
You can edit the specified program to correct the error and then run the original program.
For the syntax of the BADLINE option, see the entry for the option in OLAP DML Reference.
In a simple program called TEST, the variable MYINT1 is divided by zero.
DEFINE TEST PROGRAM PROGRAM variable myint1 integer variable myint2 integer myint1 = 0 myint2 = 250/myint1 END
If you run the program when the DIVIDEBYZERO option is set to NO, then an error occurs because division by zero is not allowed. When BADLINE is set to YES, the following messages are recorded in the current outfile.