Hi all,
I am writing a code where I need to find Hoist001, Hoist002 and so on so I have used where client_code like (Hoist%) but I also want to include some other client code. I tried to include them by using where client_code in a,b,c etc but I am getting error. So I want to know is it possible to use where statement for like and other where statement using In?
proc sql;
create table Hoist_Accs_To_Track as
(select t3.icustomerid,
t1.debt_code,
t1.client_code,
t1.Rep_code,
t2.Accountstatus,
t2.rep_descrn as Rep_Description,
t1.dt_curbal as Balance,
t1.dt_debtval as Orig_Balance,
datepart(t1.dt_rep_init_date) as Rep_Entry_Date format date9.,
datepart(t1.dt_datinstr) as Bookon_Date format date9.
from p2scflow.debt as t1
left join p2scflow.repcode as t2 on t1.rep_code = t2.rep_code
left join p2scflow.debtcust as t3 on t1.debt_code = t3.debt_code
where t1.client_code like ('HOIST%')
and where t1.client_code in ('IDEM001','IDEM002','IDEM003','IDEM004','IDEM005','IDEM006','VANQUIS215','VANQUIS216','VANQUIS217','VANQUIS218','VANQUIS219'));
run;
Error log:
29 proc sql;
30 create table Hoist_Accs_To_Track as
31 (select t3.icustomerid,
32 t1.debt_code,
33 t1.client_code,
34 t1.Rep_code,
35 t2.Accountstatus,
36 t2.rep_descrn as Rep_Description,
37 t1.dt_curbal as Balance,
38 t1.dt_debtval as Orig_Balance,
39 datepart(t1.dt_rep_init_date) as Rep_Entry_Date format date9.,
40 datepart(t1.dt_datinstr) as Bookon_Date format date9.
41 from p2scflow.debt as t1
42 left join p2scflow.repcode as t2 on t1.rep_code = t2.rep_code
43 left join p2scflow.debtcust as t3 on t1.debt_code = t3.debt_code
44 where t1.client_code like ('HOIST%')
45 and where t1.client_code in
__
22
76
45 ! ('IDEM001','IDEM002','IDEM003','IDEM004','IDEM005','IDEM006','VANQUIS215','VANQUIS216','VANQUIS217','VANQUIS218','VANQUIS
45 ! 219'));
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, (, *, **, +, -, /, <, <=, <>, =, >, >=, ?, AND, BETWEEN,
CONTAINS, EQ, EQT, GE, GET, GROUP, GT, GTT, HAVING, LE, LET, LIKE, LT, LTT, NE, NET, OR, ^=, |, ||, ~=.
ERROR 76-322: Syntax error, statement will be ignored.
2 The SAS System 15:14 Wednesday, May 17, 2023
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
46 run;
NOTE: PROC SQL statements are executed immediately; The RUN statement has no effect.
47
48 %LET _CLIENTTASKLABEL=;
49 %LET _CLIENTPROCESSFLOWNAME=;
50 %LET _CLIENTPROJECTPATH=;
51 %LET _CLIENTPROJECTPATHHOST=;
52 %LET _CLIENTPROJECTNAME=;
53 %LET _SASPROGRAMFILE=;
54 %LET _SASPROGRAMFILEHOST=;
55
56 ;*';*";*/;quit;
... View more