Remove the closing parentheses in the query at 'else 0' proc sql; create table want as select * ,(case when (Contract='yes' and Start_CR='no' and End_CR='no' and Full_year_start='yes') then CR/sum(Yearly_Premium) else 0 end) as CR_Ratio length = 8 format = 21.4 from have group by Sub_Segment, Branch ; quit; regards, gulshy
... View more