Syntax SAS语法应为SELECT

Syntax SAS语法应为SELECT,syntax,sas,quotes,proc-sql,where-in,Syntax,Sas,Quotes,Proc Sql,Where In,我不确定如何在SAS中更正proc sql中的语法。我的代码如下所示: proc sql; create table HI as select [columns] from [table] where column1 not in ('..', '..', '..') /*This has no errors*/ AND column2 in ('...', '...', '...') /*This has no errors*/ AND column3 in (('...','

我不确定如何在SAS中更正proc sql中的语法。我的代码如下所示:

proc sql;
    create table HI
    as select [columns]
from [table]
where column1 not in ('..', '..', '..') /*This has no errors*/
AND column2 in ('...', '...', '...') /*This has no errors*/
AND column3 in (('...','...','...',.......)
    or column3 like ('J%')) /*This AND statement gives the errors*/
第一个错误是,它需要一个SELECT,并在第3列的条件的第一个“…”下划线。(错误79-322)

下一个错误出现在OR语句前第3列条件的末尾。它表示它需要以下内容之一:带引号的字符串,!,!!,&,*,***,+,',',-,/,=?,。。。。。(错误22-322)

然后还有两个错误表示符号无法识别,另一个错误表示语句将被忽略--但是我想如果其他的都被纠正了,这些就会被纠正

感谢您的帮助:)

使用查找运算符

AND column3 in (('...','...','...',.......)
or (find(column3,J)>0 and substr(column3,1,1)='J') /*Making sure first char is J*/
使用查找运算符

AND column3 in (('...','...','...',.......)
or (find(column3,J)>0 and substr(column3,1,1)='J') /*Making sure first char is J*/

将最后两行更改为

 AND (column3 in ('...','...','...',.......)
or column3 like ('J%')) 

/* example*/
 proc sql;
create table HI
as select *
 from sashelp.cars
 where make not in ('Acura', 'Audi') /*This has no errors*/
  AND Type in ('SEDAN', "Sports") /*This has no errors*/
 AND (Origin in ('Asia','Europe')
  or Origin like ('U%')) ;

将最后两行更改为

 AND (column3 in ('...','...','...',.......)
or column3 like ('J%')) 

/* example*/
 proc sql;
create table HI
as select *
 from sashelp.cars
 where make not in ('Acura', 'Audi') /*This has no errors*/
  AND Type in ('SEDAN', "Sports") /*This has no errors*/
 AND (Origin in ('Asia','Europe')
  or Origin like ('U%')) ;

为column3条件添加一对括号 像这样

AND (column3 in (('...','...','...',.......)
or column3 like ('J%'))) /*This AND statement gives the errors*/

为column3条件添加一对括号 像这样

AND (column3 in (('...','...','...',.......)
or column3 like ('J%'))) /*This AND statement gives the errors*/

@基兰,我的道歉,是的,它起作用了……不知为什么我用错了syntax@Kiran,对不起,是的,它是有效的。不知怎么的,我使用了错误的语法