About the Effect on Result Sets
Within programs that are to be compiled, references to result sets (created by set-processing commands) require special care.
References to result sets can create problems, because the order in which the Compiler processes a program could be different from the order of execution. Problems can be avoided by creating permanent result sets (set objects) in the application database and ensuring that SET CHECKSETS enforces the consistency of temporary result sets.