请选择 进入手机版 | 继续访问电脑版
楼主: 贾贡献
9942 20

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

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   查看全部评分

使用道具

YueweiLiu 发表于 2011-9-26 14:11:12 |显示全部楼层 |坛友微信交流群
用 fileexist 函数来判断也可以。

使用道具

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论坛

使用道具

YueweiLiu 发表于 2011-9-26 14:23:44 |显示全部楼层 |坛友微信交流群
呵呵。 这些东西其实可以通过Google很容易找到的。

使用道具

贾贡献 发表于 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
没想到一下牵涉到这么多问题,很感谢!

使用道具

YueweiLiu 发表于 2011-9-29 11:45:20 |显示全部楼层 |坛友微信交流群
呵呵。是的,经常就是一个问题牵出一堆来。

使用道具

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.

使用道具

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

使用道具

k7847603 发表于 2017-6-22 11:17:34 |显示全部楼层 |坛友微信交流群
我也碰到楼主相同的问题了,试了下,不行啊都。。。

使用道具

learsaas 发表于 2017-6-22 13:29:37 |显示全部楼层 |坛友微信交流群
请注意:低版本的话,建议还要设置行数进行分sheet

使用道具

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

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

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

GMT+8, 2024-3-28 18:10