全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
3272 1
2016-06-12
我的数据比较大,所以需要SAS来进行处理,但是初学SAS,请各位大神赐教!

有表一:
VAR1,VAR2,VAR3,VAR4,。。。,VAR20

有表二:
VAR1,VAR3,VAR4,VAR21,。。。,VAR50

现在需求按VAR1,VAR3,VAR4来合并表格

我的程序是

proc sql;

create tablethesis_1.newdata as

select *

from thesis.new_s thesis_1.new_10_s

wherethesis_1.new_s.VAR1=thesis_1.new_10_s.VAR1 andthesis_1.new_s.VAR3=thesis_1.new_10_s.VAR2 andthesis_1.new_s.VAR4=thesis_1.new_10_s.VAR3

order bythesis_1.new_s.VAR1 thesis_1.new_s.VAR3 thesis_1.new_s.VAR4;

quit;



出现错误是

2    proc sql;
3     create table thesis_1.newdata as
4     select *
5     from thesis_1.new_s thesis_1.new_10_s
                                  -
                                  22
                                  200
ERROR 22-322: 语法错误,期望下列之一: ;, ',', ANSIMISS, CROSS, EXCEPT, FULL, GROUP, HAVING, INNER, INTERSECT, JOIN,
              LEFT, NATURAL, NOMISS, ORDER, OUTER, RIGHT, UNION, WHERE.

ERROR 200-322: 该符号不可识别,将被忽略。

6     where thesis_1.new_s.VAR1=thesis_1.new_10_s.VAR1 and thesis_1.new_s.VAR3=thesis_1.new_10_s.VAR2 and
                          -
                          22
                          76
6  ! thesis_1.new_s.VAR4=thesis_1.new_10_s.VAR3
ERROR 22-322: 语法错误,期望下列之一: ;, !, !!, &, *, **, +, -, /, <, <=, <>, =, >, >=, ?, AND, BETWEEN, CONTAINS, EQ,
              EQT, EXCEPT, GE, GET, GROUP, GT, GTT, HAVING, IN, INTERSECT, IS, LE, LET, LIKE, LT, LTT, NE, NET, NOT,
              NOTIN, OR, ORDER, OUTER, UNION, ^, ^=, |, ||, ~, ~=.

ERROR 76-322: 语法错误,语句将被忽略。

7     order by thesis_1.new_s.VAR1 thesis_1.new_s.VAR3 thesis_1.new_s.VAR4;
8    quit;
NOTE: 由于出错,SAS 系统停止处理该步。
NOTE: “PROCEDURE SQL”所用时间(总处理时间):
      实际时间          0.07 秒
      CPU 时间          0.04 秒



二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2016-6-13 16:22:46
自己顶下
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群