st: Overriding a loop if 0 observations using tabstat

Dear Statalisters
I am having problems with a loop (1 below) that contains tabstat and
would appreciate any advice.
In the command below, there are 0 observations when `i'=0 and
`y'=male. I get a message saying no observations and the loop stops.
However, when I run the loop using the tab command (for example, 2
below), the loop does not terminate when there are 0 observations but
continues to cycle through all values.
How can I get the first command to override 0 observations?
Many thanks,
1.
foreach i in 0 1 2 3 4 5 {
foreach y in male singlet{
di "Var =`y' & GA=`i'"
tabstat bwtg if myga==`i' & intab1==1 & admit_ic==1 & bwtg<., stat(n
mean median) by(`y') col(stat) f(%9.0g) notot nosep
}
}
2.
foreach i in 0 1 2 3 4 5 {
foreach y in male singlet{
di "Var =`y' & GA=`i'"
tab `y' if myga==`i' & intab1==1 & admit_ic==1 & bwtg<.
}
}
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/