tpt sql exit with bad condition code / return code
I'm new to tpt. Using Teradata version 13.10 on unix. Right now I have a tpt LOAD script then run a BTEQ script where I check some things and if certain conditions are found I return a bad condition code (for example: SELECT...; .if activitycount <> 0 then .quit 12). I want to know if I can do this all in one tpt. In tpt after the LOAD, how do I run a SELECT and check the outcome and return a bad return code? Thank you.