x******6 发帖数: 160 | 1 mentor_2_nodup_active 数据库里面有一些mentor的名字 (mentor_name_2),
mentor_one_mentee_active 数据库里面有另外一些mentor的名字 (mentor_name_1),
mentor_name_2里面的一些名字和mentor_name_1里面的名字是一样的,
我想看看哪些mentor的名字两个数据库里面都有,
我用sql create 一个 macro variable,
然后查找,可是最后给我的结果是0,原因是: The quoted string currently being
processed has become more than 262 characters long. You may have unbalanced
quotation marks.
不知道哪位sas高人能给指点一下,怎样解决这个sas macro的问题。
BTW: 我知道可以用 sas data step来merge两个 databases。可是,我不想这样做,
因为还要sort数据,rename variable。
proc sql;
select distinct mentor_name_2
into :mentor_2nd separated by ', '
from mentor_2_nodup_active;
quit;
%let mentor_2nd = &mentor_2nd;
data test;
set mentor_one_mentee_active;
if mentor_name_1 in ("&mentor_2nd") then mentor_1st_2nd = 1;
run;
Warning: The quoted string currently being processed has become more
than 262 characters long. You may have unbalanced quotation marks. | A****1 发帖数: 33 | 2 change the into operator to:
into :mentor_2 separated by '", "'
Be careful with IN operator: if var1 in ("A","B","C");
),
unbalanced
【在 x******6 的大作中提到】 : mentor_2_nodup_active 数据库里面有一些mentor的名字 (mentor_name_2), : mentor_one_mentee_active 数据库里面有另外一些mentor的名字 (mentor_name_1), : mentor_name_2里面的一些名字和mentor_name_1里面的名字是一样的, : 我想看看哪些mentor的名字两个数据库里面都有, : 我用sql create 一个 macro variable, : 然后查找,可是最后给我的结果是0,原因是: The quoted string currently being : processed has become more than 262 characters long. You may have unbalanced : quotation marks. : 不知道哪位sas高人能给指点一下,怎样解决这个sas macro的问题。 : BTW: 我知道可以用 sas data step来merge两个 databases。可是,我不想这样做,
| c******n 发帖数: 380 | 3 you can try this:
proc sql;
create table abc as select name from a where name in (select unique name
from b);
quit;
If you just want to eliminate the warning message, try 'option noquotelenmax
;' before proc sql; |
|