1
0
mirror of https://github.com/sasjs/core.git synced 2026-01-08 01:50:05 +00:00

fix: supporting empty dirs in mp_dirlist. Test updated.

This commit is contained in:
munja
2022-03-11 11:28:03 +00:00
parent 1fdbc7cce9
commit 7e9e0fac07
3 changed files with 32 additions and 15 deletions

View File

@@ -94,6 +94,13 @@ data &out_ds(compress=no
%end;
if rc = 0 then do;
did = dopen(fref);
if did=0 then do;
putlog "NOTE: This directory is empty, or does not exist - &path";
msg=sysmsg();
put msg;
put _all_;
stop;
end;
/* attribute is OS-dependent - could be "Directory" or "Directory Name" */
numopts=doptnum(did);
do i=1 to numopts;
@@ -101,12 +108,6 @@ data &out_ds(compress=no
if foption=:'Directory' then i=numopts;
end;
directory=dinfo(did,foption);
if did=0 then do;
putlog "NOTE: This directory is empty - " directory;
msg=sysmsg();
put _all_;
stop;
end;
rc = filename(fref);
end;
else do;
@@ -242,4 +243,4 @@ run;
proc sql;
drop table &out_ds;
%mend mp_dirlist;
%mend mp_dirlist;