Tips:Check if a directory exists
From sasCommunity
|
This macro returns 1 if the specified directory exists, 0 if not. |
%macro DirExist(dir) ; %LOCAL rc fileref return; %let rc = %sysfunc(filename(fileref,&dir)) ; %if %sysfunc(fexist(&fileref)) %then %let return=1; %else %let return=0; &return %mend DirExist; |
/* Usage */ option noxwait; /* SAS 8.2 only */ %put %DirExist(C:\Documents and Settings\); %put %DirExist(aaa); |
Submitted by Adrien VALLEE. Contact me at my Discussion Page.