Returns study day

Arguments 

start date as numeric sas date
end date as numeric sas date

e.g.studyday = studyday(sdate,edate);

NB the function reverses the dates to give a positive integer

function study_day(startdt,enddt);
if startdt > enddt then ndy =startdt-enddt+1;
else ndy =enddt-startdt;
return (ndy);
endsub;

data _null_;
sdate=
'01jul2001'd;
edate=
'11jul2001'd;
studyday=study_day(sdate,edate);
put 'study day ' studyday;
run;


study day 10