2017-04-14 11 views
3

私はSASASUTOSで20のパスを持つプログラム(私の同僚によって開発された)を持っています。だから、私はコードでいくつかのマクロを呼び出すと、私は簡単には、どのようなフォルダがマクロが格納されているかを判断することはできません。この目的や、現在のSASで使用できるマクロへの名前と物理パスセッション?どのSASマクロが格納されているかを調べる方法

答えて

7

コードを実行するときに役立つ2つのシステムオプションがあります。

AUTOCOMPLOCは、自動呼び出しマクロがコンパイルされたときにSASログに自動呼び出しマクロソースの場所を表示します。

MAUTOLOCDISPLAYは、マクロの実行時にログにautocallマクロソースの場所を表示します。

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; 
+0

ありがとう、トム! – PierreVanStulov

関連する問題