I am trying to check the activity count for each and every sql present in a sql file which is run using a bteq script in Unix . Following is the code snippet I am trying to use but the activity count is checked for the last sql but not for all sql's in test.sql which has say 5 sql's .
.logon -----/&&&&&,******
.os rm /home/lankirn/venkat/output.txt
.os touch /home/lankirn/venkat/output.txt
.export FILE /home/lankirn/venkat/output.txt
.run FILE=/home/lankirn/venkat/test.sql
.IF ACTIVITYCOUNT > 0 THEN .GOTO Continue
ELSE
.os rm /home/lankirn/venkat/pass.txt
.os touch /home/lankirn/venkat/pass.txt
.EXPORT DATA FILE =/home/lankirn/venkat/pass.txt
SELECT 'Data not Found';
.LABEL Continue
.os rm /home/lankirn/venkat/pass.txt
.os touch /home/lankirn/venkat/pass.txt
.EXPORT DATA FILE =/home/lankirn/venkat/pass.txt
SELECT 'Data Found';
.QUIT
Kindly help me to check the activity count of each and every sql so that i can export if the sql is returning any rows or not to a text file