楼主: previal
7965 12

SAS dataset转换成.xpt 文件时不能超过8个character??? [推广有奖]

  • 1关注
  • 1粉丝

硕士生

46%

还不是VIP/贵宾

-

威望
0
论坛币
22 个
通用积分
0
学术水平
5 点
热心指数
6 点
信用等级
3 点
经验
645 点
帖子
93
精华
0
在线时间
138 小时
注册时间
2010-5-24
最后登录
2015-7-7

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
在将SAS dataset转换成.xpt 文件的时候,如果variable namedataset name 超过8 character 就会有ERROR, 如果指定 VALIDVARNAME=V6就会截断字符串,所以想请教下怎样才可以不截断保留8位以上的变量名或数据集名在生成的xpt文件中呢?有什么option吗?
libname source 'C:\testdata';
libname xportout xport "C:\testdata\morethaneight.xpt";
proc copy in=source out=xportout memtype=data;
select morethaneight;
run;


二维码

扫码加我 拉你入群

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

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

关键词:Character dataset DataS Data Set character option source 字符串 ERROR

I believe I can fly,and I can touch the sky!
沙发
wwang111 发表于 2013-9-23 14:25:58 |只看作者 |坛友微信交流群
proc cport data=source.morethaneight file="C:\testdata\morethaneight.xpt";
run;
已有 2 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
eijuhz + 20 精彩帖子
绿水菊 + 5 + 3 + 3 + 3 精彩帖子

总评分: 经验 + 20  论坛币 + 5  学术水平 + 3  热心指数 + 3  信用等级 + 3   查看全部评分

只有一个罗纳尔多

使用道具

藤椅
previal 发表于 2013-9-23 14:35:55 |只看作者 |坛友微信交流群
wwang111 发表于 2013-9-23 14:25
proc cport data=source.morethaneight file="C:\testdata\morethaneight.xpt";
run;
谢谢回复。 不过CPORT is a proprietary format, not flexible as the XPORT,Only forward compatibility,Only low version to high version works.
用proc copy的话有没有方法避免呢?
I believe I can fly,and I can touch the sky!

使用道具

板凳
bobguy 发表于 2013-9-24 09:40:45 |只看作者 |坛友微信交流群
I believe you can not do it because the xport engine does not support it.

使用道具

报纸
绿水菊 发表于 2018-6-26 10:56:42 |只看作者 |坛友微信交流群
wwang111 发表于 2013-9-23 14:25
proc cport data=source.morethaneight file="C:\testdata\morethaneight.xpt";
run;
感谢,这样果然就解决了问题

使用道具

地板
sas9.4 发表于 2018-6-28 11:40:21 |只看作者 |坛友微信交流群
bobguy 发表于 2013-9-24 09:40
I believe you can not do it because the xport engine does not support it.
Yes. XPT apply SAS V7 engine, which can only support variable <= 8 char
已有 1 人评分经验 收起 理由
eijuhz + 20 精彩帖子

总评分: 经验 + 20   查看全部评分

使用道具

7
Theman2018 发表于 2018-9-10 08:55:09 |只看作者 |坛友微信交流群
wwang111 发表于 2013-9-23 14:25
proc cport data=source.morethaneight file="C:\testdata\morethaneight.xpt";
run;
简单向您请教一个问题。SAS文件转换为XPT格式,其中有 一句话有若干字符,现要将这句话转述,但是限制只能接收200字符,因此只能把这段话分段。而分段又有问题,这句话可能包含数字、字母、汉子、标点,截取的字符很可能就是一个汉字从中间劈开,那结果就会是一堆乱码。那么能不能实现一句若干字符的话分段,并且最长不超过200字符?求教大神,万分感激。

使用道具

8
巴黎流浪街 发表于 2018-9-13 15:24:04 |只看作者 |坛友微信交流群
Theman2018 发表于 2018-9-10 08:55
简单向您请教一个问题。SAS文件转换为XPT格式,其中有 一句话有若干字符,现要将这句话转述,但是限制只能 ...
截断的时候考虑用ksubstr而不用substr

使用道具

9
whymath 发表于 2018-9-13 22:05:27 |只看作者 |坛友微信交流群
采用V8标准就好了

使用道具

whymath 发表于 2018-9-13 22:05
采用V8标准就好了
前辈请问怎么设置V8标准呢

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-25 13:01