22%macro mp_wait4file(file, maxwait=0, interval=1);
24%
if %str(&file)=%str() %then %
do;
25 %put %str(ERR)OR: file not provided;
30 if maxwait=0 then maxwait=60*60*24*46;
31 do until (fileexist(
"&file") or slept>maxwait );
32 slept=sum(slept,sleep(&interval,1));