使用 sas 数据集中的值在数据库中创建临时表
任何人都可以帮助我使用 SAS 数据集中的值在数据库中创建临时表的语法吗?我想接下来使用这个临时表来与数据库中的其他表连接。
libname X odbc dsn=aaabbb uid=abcd pwd=efgh quote_char='';
data X.vishtest;
set test.noosbtest;
run;
我想使用 SAS 数据集“test.noosbtest”中的值创建“vishtest”作为临时表。
我在之前的尝试中创建了一个临时表,如下所示并删除其中的值,但接下来我无法将 sas 数据集的值放入此临时表中:
select * from connection to X(Create temp table vishtest as select var1 from table1 limit 20);
select * from connection to X(delete from tempdb.vishwatemp a);
can anyone help me with the syntax of creating a temp table in a database with the values from a SAS data set ? I want to use this temp table next to join with other tables in the database.
libname X odbc dsn=aaabbb uid=abcd pwd=efgh quote_char='';
data X.vishtest;
set test.noosbtest;
run;
I want to create 'vishtest' as a temp table with the values in a SAS data set 'test.noosbtest'.
I have created a temp table in an earlier attempt like the following and deleting the values in it, but next I am unable to put the values of sas data set into this temp table :
select * from connection to X(Create temp table vishtest as select var1 from table1 limit 20);
select * from connection to X(delete from tempdb.vishwatemp a);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须确保本地 sas 数据集与数据库表具有相同的列。
如果您现有的数据库表是 X.my_table 并且您的本地数据集是 mylib.the_data,您可以尝试以下操作:
如果 proc Compare 返回并告诉您这两个表是相同的,那么您应该能够将数据表加载到临时表:
You have to make sure that your local sas data set has the same columns as your database table.
If your existing database table is X.my_table and your local dataset is mylib.the_data, you can try this:
If proc compare comes back and tells you that the two tables are identical, then you should be able to load your data table into the temp table: