CORE
mm_getdirectories.sas
Go to the documentation of this file.
1 
23 %macro mm_getDirectories(
24  path=
25  ,outds=work.mm_getDirectories
26  ,mDebug=0
27  );
28 
29 %local mD;
30 %if &mDebug=1 %then %let mD=;
31 %else %let mD=%str(*);
32 %&mD.put Executing mm_getDirectories.sas;
33 %&mD.put _local_;
34 
35 data &outds (keep=directoryuri name directoryname directorydesc );
36  length directoryuri name directoryname directorydesc $256;
37  call missing(of _all_);
38  __i+1;
39 %if %length(&path)=0 %then %do;
40  do while
41  (metadata_getnobj("omsobj:Directory?@Id contains '.'",__i,directoryuri)>0);
42 %end; %else %do;
43  do while
44  (metadata_getnobj("omsobj:Directory?@DirectoryName='&path'",__i,directoryuri)>0);
45 %end;
46  __rc1=metadata_getattr(directoryuri, "Name", name);
47  __rc2=metadata_getattr(directoryuri, "DirectoryName", directoryname);
48  __rc3=metadata_getattr(directoryuri, "Desc", directorydesc);
49  &mD.putlog (_all_) (=);
50  drop __:;
51  __i+1;
52  if sum(of __rc1-__rc3)=0 then output;
53  end;
54 run;
55 
56 %mend;