2017-04-14 76 views
3

存储的SAS宏是什么文件夹我有一个程序(它是由我的同事开发的)在SASAUTOS中有20个路径。所以,当我看到在代码中调用某个宏时,我无法轻易确定宏存储在哪个文件夹中。是否有用于此目的的某个函数或系统表具有可用于当前SAS中的宏名称和物理路径会议?如何确定存储在

回答

7

当您运行代码时,有两个系统选项可以提供帮助。

AUTOCOMPLOC将在编译自动调用宏时在SAS日志中显示自动调用宏源位置。

MAUTOLOCDISPLAY将在宏运行时在日志中显示自动呼叫宏源位置。

388 options mautolocdisplay mautocomploc; 
389 %let x=%left(x); 
MAUTOCOMPLOC: The autocall macro LEFT is compiling using the autocall source file C:\Program 
      Files\SASHome\SASFoundation\9.4\core\sasmacro\left.sas. 
MAUTOLOCDISPLAY(LEFT): This macro was compiled from the autocall file C:\Program 
         Files\SASHome\SASFoundation\9.4\core\sasmacro\left.sas 
MAUTOCOMPLOC: The autocall macro VERIFY is compiling using the autocall source file C:\Program 
      Files\SASHome\SASFoundation\9.4\core\sasmacro\verify.sas. 
MAUTOLOCDISPLAY(VERIFY): This macro was compiled from the autocall file C:\Program 
          Files\SASHome\SASFoundation\9.4\core\sasmacro\verify.sas 
390 %let x=%left(x); 
MAUTOLOCDISPLAY(LEFT): This macro was compiled from the autocall file C:\Program 
         Files\SASHome\SASFoundation\9.4\core\sasmacro\left.sas 
MAUTOLOCDISPLAY(VERIFY): This macro was compiled from the autocall file C:\Program 
          Files\SASHome\SASFoundation\9.4\core\sasmacro\verify.sas 

如果你只是想找出某个文件的位置,那么你可以尝试让SAS为你找到它。制作一个指向与SASAUTOS设置相同的文件夹的聚合fileref。

filename xx ('path1' 'path2' 'path3') ; 

然后使用一个简单的INFILE语句来查找特定文件的路径。

data _null_; 
    length fname $500; 
    infile xx('mymacro.sas') filename=fname; 
    input; 
    put fname= ; 
    stop; 
run; 
+0

非常感谢,汤姆! – PierreVanStulov

相关问题