我有一个程序(由我的同事开发),在SASAUTOS中有20条路径.因此,当我在代码中看到调用某个宏时,我无法轻易确定宏存储在哪个文件夹中.是否有一些用于此目的的函数或系统表,其中包含可用于当前SAS的宏的名称和物理路径会议?
运行代码时,有两个系统选项可以提供帮助.
MAUTOCOMPLOC 编译自动调用宏时,将在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
Run Code Online (Sandbox Code Playgroud)
如果您只想弄清楚特定文件的位置,那么您可以尝试让SAS为您找到它.创建一个指向与SASAUTOS设置相同的文件夹的聚合fileref.
filename xx ('path1' 'path2' 'path3') ;
Run Code Online (Sandbox Code Playgroud)
然后使用简单的INFILE语句查找特定文件的路径.
data _null_;
length fname $500;
infile xx('mymacro.sas') filename=fname;
input;
put fname= ;
stop;
run;
Run Code Online (Sandbox Code Playgroud)