24%macro mm_getfoldertree(
26 ,outds=work.mm_getfoldertree
33%
if &level>&depth %then %
return;
36%
if &mDebug=1 %then %let mD=;
38%&mD.put Executing &sysmacroname;
41%
if &append=NO %then %
do;
44 proc sql; drop table &outds;
48data &outds.TMP/view=&outds.TMP;
49 length metauri pathuri $64 name $256 path $1024
50 assoctype publictype MetadataUpdated MetadataCreated $32;
51 keep metauri assoctype name publictype MetadataUpdated MetadataCreated path;
52 call missing(of _all_);
54 rc=metadata_pathobj(
"",path,
"Folder",publictype,pathuri);
55 if publictype ne
'Tree' then
do;
56 putlog
"%str(WAR)NING: Tree " path
'does not exist!' publictype=;
60 do while(metadata_getnasl(pathuri,__n1,assoctype)>0);
64 if assoctype in (
'Members',
'SubTrees') then
65 do while(metadata_getnasn(pathuri,assoctype,__n2,metauri)>0);
67 call missing(name,publictype,MetadataUpdated,MetadataCreated);
68 __rc1=metadata_getattr(metauri,"Name", name);
69 __rc2=metadata_getattr(metauri,"MetadataUpdated", MetadataUpdated);
70 __rc3=metadata_getattr(metauri,"MetadataCreated", MetadataCreated);
71 __rc4=metadata_getattr(metauri,"PublicType", PublicType);
79proc append base=&outds data=&outds.TMP;
83 set &outds.TMP(where=(assoctype='SubTrees'));
84 call execute('%mm_getfoldertree(root='
85 !!cats(path,"/",name)!!",outds=&outds,mDebug=&mdebug,depth=&depth"
86 !!",level=%eval(&level+1),append=YES)");
89%mend mm_getfoldertree;