07-30-2014 10:21 AM
I have some code that runs fine but when i add in the case statement on Proc SQL it 'falls over'. Can anyone please advise where I am going wrong with the complete statement?
create table work.red as
count(*) as count,
avg (tv) ,
remaining_months <= 1 then 'End'
else if Remaining_months <= 12 then 'End OP'
else if arrs not in '1' then 'Ars' else 'Rege' end as Red_son
platform = 'O'
and Arrs not in ('L4','L5','L6')
07-30-2014 10:34 AM
you are mixing SAS syntax and SQL there:
case when remaining_months <= 1 then 'End'
when Remaining_months <= 12 then 'End OP'
when arrs not in '1' then 'Ars'
else 'Rege' end as Red_son
The syntax is:
case when [condition] then [result]
else [fallout response] end
Need further help from the community? Please ask a new question.