Using GET DATA and PUT DATA statements for debugging can prove very helpful. When you use these statements, however, you generally pay the price of decreased performance. This cost to performance is usually very high when you use either GET DATA or PUT DATA without a variable list.
Many programmers use PUT DATA statements in their ON ERROR code as illustrated in the following example:
on error
begin;
on error system;
.
.
.
put data;
.
.
.
end;In this case, the program would perform more optimally by including a list of selected variables with the PUT DATA statement.
The ON ERROR block in the previous example contained an ON ERROR system statement before the PUT DATA statement. This prevents the program from getting caught in an infinite loop if an error occurs in the PUT DATA statement (which could occur if any variables to be listed contained invalid FIXED DECIMAL values) or elsewhere in the ON ERROR block.