gpt4 book ai didi

sas - 如何确定SAS宏存储在哪个文件夹中

转载 作者:行者123 更新时间:2023-12-04 20:11:16 24 4
gpt4 key购买 nike

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

最佳答案

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

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

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

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

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

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

关于sas - 如何确定SAS宏存储在哪个文件夹中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43408073/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com