SAS中文论坛
标题:
使用%nowpath宏获取当前SAS路径
[打印本页]
作者:
shiyiming
时间:
2011-8-27 22:32
标题:
使用%nowpath宏获取当前SAS路径
From hssnow's blog on hssnow.name
前几天学习了一个叫mypath的宏,其实现了将当前sas程序的路径定义为一个宏变量、以方便后续调用路径的功能。查了下相关资料,在《Generating Program-Stamped Output in an Interactive SAS Session》中,也有个叫fullpath的宏,是提取当前路径为宏变量后进行应用。 个人觉得这2个实现路径提取功能的宏及其中的编程技巧挺有用的,拿出来分享一下。 1.%nowpath 1.1 将%mypath和%fullpath作了小小改动、整合成了下面的宏%nowpath ?View Code SAS1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 %macro nowpath; %global fullpath nowpath; /*定义为global,为后续调用准备*/ proc sql noprint; select xpath into : fullpath /*选取全路径*/ from dictionary.extfiles /*dictionary.extfiles包含SAS路径信息*/ where substr(fileref,4) eq [...]
欢迎光临 SAS中文论坛 (http://mysas.net/forum/)
Powered by Discuz! X3.2