CORE
mm_getstps.sas
Go to the documentation of this file.
1 
40 %macro mm_getstps(
41  tree=
42  ,name=
43  ,outds=work.mm_getstps
44  ,mDebug=0
45  ,showDesc=
46  ,showUsageVersion=
47  );
48 
49 %local mD;
50 %if &mDebug=1 %then %let mD=;
51 %else %let mD=%str(*);
52 %&mD.put Executing mm_getstps.sas;
53 %&mD.put _local_;
54 
55 data &outds;
56  length stpuri stpname usageversion treeuri stpdesc $256;
57  call missing (of _all);
58 run;
59 
60 %if %length(&tree)>0 %then %do;
61  /* get tree info */
62  %mm_getTree(tree=&tree,inds=&outds, outds=&outds, mDebug=&mDebug)
63  %if %mf_nobs(&outds)=0 %then %do;
64  %put NOTE: Tree &tree did not exist!!;
65  %return;
66  %end;
67 %end;
68 
69 
70 
71 data &outds ;
72  set &outds(rename=(treeuri=treeuri_compare));
73  length treeuri query $256;
74  i+1;
75 %if %length(&name)>0 %then %do;
76  query="omsobj:ClassifierMap?@PublicType='StoredProcess' and @Name='&name'";
77 %end;
78 %else %do;
79  query="omsobj:ClassifierMap?@PublicType='StoredProcess'";
80 %end;
81  do while(0<metadata_getnobj(query,i,stpuri));
82  i+1;
83  rc1=metadata_getattr(stpuri,"Name", stpname);
84  rc2=metadata_getnasn(stpuri,"Trees",1,treeuri);
85  %if %length(&tree)>0 %then %do;
86  if treeuri ne treeuri_compare then goto exitloop;
87  %end;
88  %if %length(&showDesc)>0 %then %do;
89  rc3=metadata_getattr(stpuri,"Desc", stpdesc);
90  keep stpdesc;
91  %end;
92  %if %length(&showUsageVersion)>0 %then %do;
93  rc4=metadata_getattr(stpuri,"UsageVersion",UsageVersion);
94  keep usageversion;
95  %end;
96  output;
97  exitloop:
98  end;
99  keep stpuri stpname treeuri;
100 run;
101 
102 %mend;