Hi,

I want to create a daily report of survey submissions for each enumerator-supervisor team made on the previous day
In the report, I want disaggregated numbers for each enumerator reporting the status of calls (complete/refused/rescheduled) and the number under each status.

I am doing this by writing a loop and exporting results using - putexcel.
However, it is possible that an enumerator may not encounter a particular kind of status in the previous day.

gen yesterday = date("`c(current_date)'", "DMY") - 1
local usernames Paras Vedbati Sonia Kamlavati Sucheta

local ncol = 2 /* start the table in column B*/
foreach x of local usernames {
local col: word `ncol' of `c(ALPHA)'
putexcel `col'6 = ("`x'")
tabulate outcome if subdate == yesterday & supervisor_name == "Neha" & first_enum_name == "`x'" & phone_response_short=="Asked to call a different number" , matcell(freq)
putexcel `col'7 = matrix(freq)
tabulate outcome if subdate == yesterday & supervisor_name == "Neha" & first_enum_name == "`x'" & phone_response_short=="Complete", matcell(freq)
putexcel `col'8 = matrix(freq)

local ++ncol
}

Now under this loop , when Stata encounters an enumerator who may not have had encountered for instance the outcome phone_response_short=="Asked to call a different number"', then it throws an error as below:
no observations
freq not found
r(111);

How can I ensure that the loop continues, instances with no observations are ignored and the putexcel continues to run?

Would appreciate any help!
Thanks,
Rosa