Same logic just not using sub-setting IF. Does this make it better understandable for you?
/**
calculating number of incidents of zero returns everyday
and number of zero returns in each of those incidents
**/
data Zero_Returns;
set HUF;
by Date Return notsorted;
if first.Date then Incident_No= 0;
if first.Return then Consecutive_Zero= 1;
else Consecutive_Zero+1;
if last.Return and Return= 0 then
do;
Incident_No+1;
output;
end;
run;