There's a way to jerry-rig an if/then using the decode or case statement in SQL+. I have done a couple of variations, but I think this will give you the basic idea. I'm running the second query (X2) using '@' based on the value from the Accept statement. If yes, xspl is set to X2 (the conditional program to run that contains the query and the spool statement).