In reply to Benjamin Ben-Baruch.

Benjamin, for this humble and practical purpose, you can shield yourself from post-vacation stress and the ERRORs of accidentally dividing by zero by using SAS' divide() function. It produces special missing values (.I for ∞, .M for -∞) for zero denominator and no erros. Run this code to see what it does:

data _null_;
x = divide(5,0);
if x=.I then put x=;
if missing(x) then put x=;

n=-5; d=0;
x=divide(n,d);
if x=.M then put x=;
if missing(x) then put x=;
run;