作者peiyu0710 (peiyu)
看板Statistics
标题[程式] 使用SAS打开SAS档,数据不全
时间Fri Jun 21 22:16:07 2013
[软体程式类别]:
SAS9.3 (ENGLISH)
[程式问题]:
拿到sas资料档(sas data set)之後想要直接汇入SAS,结果少了一大半数据
[软体熟悉度]:
低(1~3个月)-断断续续有在学基本语法,但有一阵子没碰了
[问题叙述]:
1、如果直接点开档案(.SAS),会出现视窗,其中文字为:
开啓作业失败,发生下列错误。
【Error】Falled to transcode data from utf-16le to wlatin1 encoding
because it contained charaters which are not supported by your
SAS session encoding. Please review your encoding= and locale =
SAS system options to ensure that they can accommodate the data
that you want to process. A portion of the source string, in hex
representation is:
[None] 1b52cc: 47 00 3a 00 5c 00 62 00 6f 00 73 00 74 00 6f 00
[C:\]
2、如果直接用SAS打开档案,只会出现1-6栏数据,後面都读不出来
3、查过书(SAS1-2-3、SAS与统计分析)、GOOGLE(关键字:SAS utf-16le to
wlatin1),但是找不到解决方法
[程式范例]:
目前google到的程式如下,但是最多只能读进6栏数据,问题没有解决...
1、data myfiles.difencoding (encoding=wlatin1);
(出处:support.sas.com/documentation/cdl/en/nlsref/61893/HTML/default/
viewer.htm
#a002601944.htm)
2、
proc datasets lib=SDTM;
modify supplb/correctencoding=wlatin1;
run;
/* Set the correct encoding to ‘WLATIN1’ */
proc datasets lib=stagings;
modify custtype_w1/correctencoding=wlatin1;
run;
/* Transcode data from ‘Wlatin1’ to ‘UTF-8’ */
data stagings.custtype_u8;
set stagings.custtype_w1;
run;
(出处:
http://studysas.blogspot.tw/2012/02/encodingoption-
correctencodingwlatin1.html)
恳请帮忙指点一下可以如何读到剩下的数据,非常感谢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 124.11.138.221
1F:推 tew:原始档案已毁了 请重新取得 06/22 09:45
2F:→ peiyu0710:谢谢回应,可能是电脑有问题,换另一台电脑就解决了... 06/22 22:56
3F:推 anovachen:有可能是跟语言编码有关!!我遇过在中文版读不到资料, 06/23 03:11
4F:→ anovachen:要在英文版SAS才能读取资料的情形...= = 06/23 03:11
5F:→ anovachen:呃,讲反了。是资料里有繁体中文字,英文版的读不到 06/23 03:11