You're right there was a field that needed to be updated; now crusid is inptid ; I replaced in the two spots - in the select and the where statement and still got the error:
proc sql;
connect to oracle as test (user=%SUPERQ(dra_u) password="&dra_p." path=huvhg);
create table now1(drop=crdttm) as
select *,
crdttm as act_dttm format=datetime24.3
from connection to test
(select distinct a.avdttm,
a.id,
a.acttpcd,
a.actrscd,
a.actotcom_cd,
a.inptid as emp_id,
a.cmtrid,
a.act_dttm as crdttm,
c.mktcd,
c.srcstcd,
d.pur_id,
d.bol_cd,
d.clmplcd,
d.ent,
case when d.plancd in ('MMM','RRR','DDDD') then 'RNM'
else 'INE'
end as Business,
d.plancd
from dra.rsh_dra_snart_act as a
left join dra.rsh_dra_case as c
on a.id = c.id
left join dra.rsh_dra_nonmdm_mbr as d
on c.id = d.id
where trunc(a.act_dttm) between to_date(&start.,'yyyy-mm-dd') and to_date(&end.,'yyyy-mm-dd')
and a.inptid in (&role1.)
and (c.srcstcd not in ('5','6') or c.srcstcd is null)
and (d.pur_id not in ('0001234','0005678') or d.pur_id is null)
order by a.id, a.act_dttm);
disconnect from test;
quit;
ERROR: ORACLE prepare error: ORA-00933: SQL command not properly ended.
... View more