Isleapyr function -returns 1 if a leap year

isleapyr(2001)

*returns 1 if year is leap year;
function isleapyr(x );
length leapfl 3;
leapfl=
0;
if mod(x,4)=0 then leapfl=1;
if mod(x,100)= 0 and mod(x,400)  ne 0 then leapfl=0;
return(leapfl);
endsub;
data _null_;
do year=1999 to 2005;
  rc=isleapyr(year);
 
put year rc;
end;
run;

Results
1999 0
2000 1
2001 0
2002 0
2003 0
2004 1
2005 0