Hi Expert,
I am not sure about the syntax error. I think my code is correct but getting error.
proc sql;
create table Chase_Linked as
select distinct *
from Address_Check
where accountstatus = 'Campaign','Chase','Chase Hold','Paying';
create table Chase_Linked2 as
select distinct *,
sum(Postcode_Check) as Acc_Check,
count(debt_code) as Linked_Count
from Chase_Linked
group by icustomerid;
create table Chase_Linked3 as
select distinct *,
case when sum(Acc_Check) = sum(Linked_Count) then 'Y' else 'N'
end as Cust_Check
from Chase_Linked2
group by icustomerid;
create table Trace_Chase_Linked as
select distinct(Trace_Acc),
Trace_Rep,
Trace_Status
from Chase_Linked3
where Cust_Check = 'Y';
quit;
Error log:
30 proc sql;
31 create table Chase_Linked as
32 select distinct *
33 from Address_Check
34 where accountstatus = 'Campaign','Chase','Chase Hold','Paying';
_
22
76
ERROR 22-322: Syntax error, expecting one of the following: ;, !, !!, &, *, **, +, -, /, <, <=, <>, =, >, >=, AND, EQ, EQT, EXCEPT,
GE, GET, GROUP, GT, GTT, HAVING, INTERSECT, LE, LET, LT, LTT, NE, NET, NOT, OR, ORDER, OUTER, UNION, ^, ^=, |, ||, ~,
~=.
ERROR 76-322: Syntax error, statement will be ignored.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
35
36 create table Chase_Linked2 as
37 select distinct *,
38 sum(Postcode_Check) as Acc_Check,
39 count(debt_code) as Linked_Count
40 from Chase_Linked
41 group by icustomerid;
NOTE: Statement not executed due to NOEXEC option.
Can you please check the code and error log to find it?
... View more