Your syntax looks really strange (what languages uses "RETURN X IF Y" syntax?) and also the logic of your formula seems off.
In SAS it is simple because logical expressions evaluate to 0 or 1.
proc sql ;
select sum( return=0 ) as n_zero
, count(*) as n
, calculated n_zero / calculated n as percent_zero
from have
;
quit;
In other flavors of SQL you will want to use a CASE statement. Also since other languages do not have the CALCULATED keyword you might need to replicate the formulas or use a nested query to get both the count and the percentage in one query.