全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
2750 3
2012-01-11
悬赏 30 个论坛币 未解决
在用SAS读入文件时文件夹名称和文件名包含减号"-"(注意不是下划线)。导致无法被SAS识别,比如读:
C:\abc - 123-c\abc - 123-c.txt
这个文件,SAS提示错误:ERROR: Physical file does not exist
再不改变名称的情况下如何解决?
多谢
二维码

扫码加我 拉你入群

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

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

全部回复
2012-1-11 09:06:23
I created a file, named "t- e_s#$%^&!~t", and a text file, named "t- e_s#$%^&!~t.txt". My program and results could be found bellow. Maybe it was not the matter of SAS.


9    data test;
10       infile "E:\t- e_s#$%^&!~t\t- e_s#$%^&!~t.txt";
11       input name $;
12   run;

NOTE: Infile "E:\t- e_s#$%^&!~t\t- e_s#$%^&!~t.txt" 是:
      文件名=E:\t- e_s#$%^&!~t\t- e_s#$%^&!~t.txt,
      RECFM=V,LRECL=256

NOTE: 从 Infile "E:\t- e_s#$%^&!~t\t- e_s#$%^&!~t.txt" 中读取了 2 条记录。
       最小记录长度是 5。
       最大记录长度是 5。
NOTE: 数据集 WORK.TEST 有 2 个观测和 1 个变量。
NOTE: “DATA 语句”所用时间(总处理时间):
      实际时间         0.04 秒
      CPU 时间         0.03 秒
二维码

扫码加我 拉你入群

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

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

2012-1-11 09:37:46
这个问题应该不是减号引起的
而是空格
用SAS批量改个名字,然后再导入就好了
这种加空格的命名方式本来就不好,改了也无所谓
二维码

扫码加我 拉你入群

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

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

2012-1-11 15:25:03
Alternatively, you may check the 8dot3 alias for the file and the directory using dir /x command in a cmd window or X command in SAS. An example in the cmd window follows. In my case it shoud work by using infile "I:\ABC-12~1\ABC-12~1.TXT".


附件列表
cmd.jpg

原图尺寸 64.96 KB

cmd.jpg

二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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