I wanted to calculate the Indian financial quarter which starts in April (April-Jun would be 1st Qtr). I created a user defined function using the proc fcmp procedure yet it is not giving me the correct answer. What is wrong with my logic? proc fcmp outlib=three.level.name; function FinQuart(dat); if month(dat) in(4,5,6) then qurt = 1; if month(dat) in(7,8,9) then qurt = 2; if month(dat) in(10,11,12) then qurt = 3; if month(dat) in(1,2,3) then qurt = 4; return (qurt); endsub; run; The function returns 4 whatever value you submit.
... View more