- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I need support with my case statement please. I have a calcualted field within the CASE statement but I can't seem to get it to work?
This is my error message -
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, (, *, **, +, -, '.', /, <, <=, <>, =, >, >=, ?, AND,
BETWEEN, CONTAINS, EQ, EQT, GE, GET, GT, GTT, IN, IS, LE, LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, THEN, ^,
^=, |, ||, ~, ~=.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
proc sql;
create table work.dtv as
select
distinct month_date,
balance_outstanding as balance,
curr_index_val as val,
avg (curr_index_val) as avg_val,
round(balance/val,0.00001) as dtv format percent8.2,
case
when calculated dtv <30 then 'Less than 30%'
when calcualted dtv =>30 and <50 then '30%-50%'
when calcualted dtv =>50 and <60 then '50%-60%'
when calculated dtv =>60 and <75 then '60%-75%'
when calculated dtv =>75 and <95 then '75%-95%'
when calculated dtv =>95 and <100 then '95%-100%'
else '100%+' end as avedtv
from
gbasel.baseljul14
where optimum_platform = 'Optimum'
and Arrears_lit_stage_code not in ('L4','L5','L6')
group by
month_date, avedtv;
quit;