楼主: 贾贡献
11044 20

[原创博文] 输出数据结果时,如何用标签值代替变量名? [推广有奖]

11
YueweiLiu 发表于 2011-9-26 14:03:16
参见:http://www.sas.com/offices/europ ... tips/ht1_mar04.html
  1. %macro chk_dir(dir=) ;
  2.    options noxwait;
  3.    %local rc fileref ;
  4.    %let rc = %sysfunc(filename(fileref,&dir)) ;
  5.    %if %sysfunc(fexist(&fileref))  %then
  6.       %put NOTE: The directory "&dir" exists ;
  7.    %else
  8.      %do ;
  9.          %sysexec md   &dir ;
  10.          %put %sysfunc(sysmsg()) The directory has been created. ;
  11.    %end ;
  12.    %let rc=%sysfunc(filename(fileref)) ;
  13. %mend chk_dir ;

  14. %chk_dir(dir=c:\temp) ;    %*   <==  your directory specification goes here ;
  15. %chk_dir(dir=c:\temp\sascode)   
复制代码
已有 2 人评分学术水平 热心指数 收起 理由
webgu + 1 很热心呵
playmore + 1 + 1 热心帮助其他会员

总评分: 学术水平 + 2  热心指数 + 1   查看全部评分

12
YueweiLiu 发表于 2011-9-26 14:11:12
用 fileexist 函数来判断也可以。

13
playmore 发表于 2011-9-26 14:14:15
YueweiLiu 发表于 2011-9-26 14:03
参见:http://www.sas.com/offices/europe/uk/support/sas-hints-tips/ht1_mar04.html
多谢了

你给的例子真不错

过去一直自己用自己写的宏,robust考虑的不够

现在要给别人用,就得考虑的多些了

还有低版本的SAS用起来麻烦真是挺多的
playmore邀请您访问ChinaTeX论坛!!!进入ChinaTeX论坛

14
YueweiLiu 发表于 2011-9-26 14:23:44
呵呵。 这些东西其实可以通过Google很容易找到的。

15
贾贡献 发表于 2011-9-29 10:42:12
YueweiLiu 发表于 2011-9-26 14:03
参见:http://www.sas.com/offices/europe/uk/support/sas-hints-tips/ht1_mar04.html
没想到一下牵涉到这么多问题,很感谢!

16
YueweiLiu 发表于 2011-9-29 11:45:20
呵呵。是的,经常就是一个问题牵出一堆来。

17
naruto_zw 发表于 2013-5-9 15:15:09
YueweiLiu 发表于 2011-9-26 11:26
可以使用 libname 语句,结合 dblabel= option 来控制输出:
请教一下,excel文件显示已损坏,日志中NOTE: SAS variable labels, formats, and lengths are not written to DBMS tables.

18
神月德 发表于 2015-12-17 15:46:04
YueweiLiu 发表于 2011-9-26 11:26
可以使用 libname 语句,结合 dblabel= option 来控制输出:
请问一下,这个data test.class是什么意思,输出文件sample和class没关系了吧

19
k7847603 发表于 2017-6-22 11:17:34
我也碰到楼主相同的问题了,试了下,不行啊都。。。

20
learsaas 发表于 2017-6-22 13:29:37
请注意:低版本的话,建议还要设置行数进行分sheet

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-19 07:42