全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
3626 9
2013-05-08
悬赏 500 个论坛币 已解决
复制代码

用上面这段代码从SQL Server中取表a中的数据其中code在sql中保存为text类型
运行后,创建的sas数据集code中code字段的内容数据库中的内容要少,如果要获取完整内容要怎么解决
code中有6w字左右

最佳答案

邓贵大 查看完整内容

You got the error because you may not have the sqlsrv engine. It can be verified in PROC SETINIT. Try the ODBC or OLEDB engine instead.
二维码

扫码加我 拉你入群

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

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

全部回复
2013-5-8 18:45:01
You got the error because you may not have the sqlsrv engine. It can be verified in PROC SETINIT.
Try the ODBC or OLEDB engine instead.
复制代码
二维码

扫码加我 拉你入群

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

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

2013-5-8 18:51:31
Just my thought.
(1) the length of a SAS character variable is limited up to 32767, so your SQL text might have been truncated.
(2) you may create a SQL Server view with the code variable separated into two pieces, then let SAS read the view. If you're not allowed to create views in the database, create a temporary table sort of thing would be fine.
二维码

扫码加我 拉你入群

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

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

2013-5-8 19:05:50
邓贵大 发表于 2013-5-8 18:51
Just my thought.
(1) the length of a SAS character variable is limited up to 32767, so your SQL tex ...
I only get 1000 character far away from 32767
Do you know what happen?
二维码

扫码加我 拉你入群

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

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

2013-5-8 19:14:14
zhou.wen 发表于 2013-5-8 19:05
I only get 1000 character far away from 32767
Do you know what happen?
no idea! haven't used SQL Server since I went down hell.
Maybe it's because SAS cannot determine the actual length of a SQL TEXT or VARCHAR(MAX) field, then it decides by itself to keep the first 1000 characters?
http://support.sas.com/documentation/cdl/en/acreldb/65247/HTML/default/viewer.htm#n1aqglg4ftdj04n1eyvh2l3367ql.htm
Check the link above, the default value for DBMAX_TEXT is 1024. How the hell you got 1,000?!

Anyway, I think you may break your SQL TEXT field into either 8 VARCHAR(7500) fields or 2 VARCHAR(MAX) fields. In the latter case, set option DBMAX_TEXT to 32767 as well. Then SAS should be able to handle that.
二维码

扫码加我 拉你入群

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

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

2013-5-9 10:58:15
邓贵大 发表于 2013-5-8 19:14
no idea! haven't used SQL Server since I went down hell.
Maybe it's because SAS cannot determin ...
thank for helping
My fault.the accurate number is 1024
But the DBMAX_TEXT is only supported in the libname statement
As soon as I run the code as follow ,it turn out the errors.
复制代码
The error is:
复制代码
what does it mean? I haven't install the SQLSVR engine?But I do run the code using the "SQL PASS:proc sql" successfully !
Can you give me some advice?
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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