1
0
mirror of https://github.com/sasjs/core.git synced 2026-04-21 15:31:31 +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
+9 -7
View File
@@ -4214,6 +4214,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;
@@ -4221,12 +4228,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;
@@ -4362,7 +4363,8 @@ run;
proc sql;
drop table &out_ds;
%mend mp_dirlist;/**
%mend mp_dirlist;
/**
@file
@brief Creates a dataset containing distinct _formatted_ values
@details If no format is supplied, then the original value is used instead.