Hello Experts,
In the data RGA I have the multiple values of d_fin by is_support.
d_fin is the date of creation, I need to choose the most recent or with the empty value.
I try to use "having" but I have the syntax error :
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, (, *, **, +, -, /, <, <=, <>, =, >, >=, ?, AND, BETWEEN, CONTAINS, EQ, EQT, GE, GET, GT, GTT, LE, LET, LIKE, LT, LTT, NE, NET, OR, ^=, |, ||, ~=.
ERROR 76-322: Syntax error, statement will be ignored.
Could you help me please ?
proc sql;
create table Donnees as select c.cd_rga, b.is_support, c.lb_court, b.d_fin,a.mt_ea,
sum(a.mt_ea) as total
from SUPPORT as a
left join RGA as b on a.is_support=b.is_support and (having b.d_fin=. or max(b.d_fin)=b.d_fin)
left join RGPC as c on b.is_rga=c.is_rga
where a.s_type_support="OK"
group by c.cd_rga
;
quit;
Thank you !
... View more