mirror of
https://github.com/sasjs/core.git
synced 2026-01-06 00:50:05 +00:00
feat: filter mm_getusers on a particular user
This can be useful for extracting the uri of a metadata user
This commit is contained in:
60
all.sas
60
all.sas
@@ -17783,17 +17783,18 @@ libname _XML_ clear;
|
|||||||
|
|
||||||
%mm_getusers()
|
%mm_getusers()
|
||||||
|
|
||||||
|
Optionally, filter for a user (useful to get the uri):
|
||||||
|
|
||||||
|
%mm_getusers(user=&_metaperson)
|
||||||
|
|
||||||
@param outds the dataset to create that contains the list of libraries
|
@param outds the dataset to create that contains the list of libraries
|
||||||
|
|
||||||
@returns outds dataset containing all users, with the following columns:
|
@returns outds dataset containing all users, with the following columns:
|
||||||
- uri
|
- uri
|
||||||
- name
|
- name
|
||||||
|
|
||||||
@warning The following filenames are created and then de-assigned:
|
@param user= (0) Set to a metadata user to filter on that user
|
||||||
|
@param outds= (work.mm_getusers) The output table to create
|
||||||
filename sxlemap clear;
|
|
||||||
filename response clear;
|
|
||||||
libname _XML_ clear;
|
|
||||||
|
|
||||||
@version 9.3
|
@version 9.3
|
||||||
@author Allan Bowe
|
@author Allan Bowe
|
||||||
@@ -17801,23 +17802,44 @@ libname _XML_ clear;
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
%macro mm_getusers(
|
%macro mm_getusers(
|
||||||
outds=work.mm_getusers
|
outds=work.mm_getusers,
|
||||||
|
user=0
|
||||||
)/*/STORE SOURCE*/;
|
)/*/STORE SOURCE*/;
|
||||||
|
|
||||||
filename response temp;
|
filename response temp;
|
||||||
proc metadata in= '<GetMetadataObjects>
|
|
||||||
<Reposid>$METAREPOSITORY</Reposid>
|
%if %superq(&user)=0 %then %do;
|
||||||
<Type>Person</Type>
|
proc metadata in= '<GetMetadataObjects>
|
||||||
<NS>SAS</NS>
|
<Reposid>$METAREPOSITORY</Reposid>
|
||||||
<Flags>0</Flags>
|
<Type>Person</Type>
|
||||||
<Options>
|
<NS>SAS</NS>
|
||||||
<Templates>
|
<Flags>0</Flags>
|
||||||
<Person Name=""/>
|
<Options>
|
||||||
</Templates>
|
<Templates>
|
||||||
</Options>
|
<Person Name=""/>
|
||||||
</GetMetadataObjects>'
|
</Templates>
|
||||||
out=response;
|
</Options>
|
||||||
run;
|
</GetMetadataObjects>'
|
||||||
|
out=response;
|
||||||
|
run;
|
||||||
|
%end;
|
||||||
|
%else %do;
|
||||||
|
proc metadata in= "<GetMetadataObjects>
|
||||||
|
<Reposid>$METAREPOSITORY</Reposid>
|
||||||
|
<Type>Person</Type>
|
||||||
|
<NS>SAS</NS>
|
||||||
|
<!-- Specify the OMI_XMLSELECT (128) flag -->
|
||||||
|
<Flags>128</Flags>
|
||||||
|
<Options>
|
||||||
|
<Templates>
|
||||||
|
<Person Name=""/>
|
||||||
|
</Templates>
|
||||||
|
<XMLSELECT search=""Person[@Name='&user']""/>
|
||||||
|
</Options>
|
||||||
|
</GetMetadataObjects>"
|
||||||
|
out=response;
|
||||||
|
run;
|
||||||
|
%end;
|
||||||
|
|
||||||
filename sxlemap temp;
|
filename sxlemap temp;
|
||||||
data _null_;
|
data _null_;
|
||||||
|
|||||||
@@ -8,17 +8,18 @@
|
|||||||
|
|
||||||
%mm_getusers()
|
%mm_getusers()
|
||||||
|
|
||||||
|
Optionally, filter for a user (useful to get the uri):
|
||||||
|
|
||||||
|
%mm_getusers(user=&_metaperson)
|
||||||
|
|
||||||
@param outds the dataset to create that contains the list of libraries
|
@param outds the dataset to create that contains the list of libraries
|
||||||
|
|
||||||
@returns outds dataset containing all users, with the following columns:
|
@returns outds dataset containing all users, with the following columns:
|
||||||
- uri
|
- uri
|
||||||
- name
|
- name
|
||||||
|
|
||||||
@warning The following filenames are created and then de-assigned:
|
@param user= (0) Set to a metadata user to filter on that user
|
||||||
|
@param outds= (work.mm_getusers) The output table to create
|
||||||
filename sxlemap clear;
|
|
||||||
filename response clear;
|
|
||||||
libname _XML_ clear;
|
|
||||||
|
|
||||||
@version 9.3
|
@version 9.3
|
||||||
@author Allan Bowe
|
@author Allan Bowe
|
||||||
@@ -26,23 +27,44 @@
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
%macro mm_getusers(
|
%macro mm_getusers(
|
||||||
outds=work.mm_getusers
|
outds=work.mm_getusers,
|
||||||
|
user=0
|
||||||
)/*/STORE SOURCE*/;
|
)/*/STORE SOURCE*/;
|
||||||
|
|
||||||
filename response temp;
|
filename response temp;
|
||||||
proc metadata in= '<GetMetadataObjects>
|
|
||||||
<Reposid>$METAREPOSITORY</Reposid>
|
%if %superq(&user)=0 %then %do;
|
||||||
<Type>Person</Type>
|
proc metadata in= '<GetMetadataObjects>
|
||||||
<NS>SAS</NS>
|
<Reposid>$METAREPOSITORY</Reposid>
|
||||||
<Flags>0</Flags>
|
<Type>Person</Type>
|
||||||
<Options>
|
<NS>SAS</NS>
|
||||||
<Templates>
|
<Flags>0</Flags>
|
||||||
<Person Name=""/>
|
<Options>
|
||||||
</Templates>
|
<Templates>
|
||||||
</Options>
|
<Person Name=""/>
|
||||||
</GetMetadataObjects>'
|
</Templates>
|
||||||
out=response;
|
</Options>
|
||||||
run;
|
</GetMetadataObjects>'
|
||||||
|
out=response;
|
||||||
|
run;
|
||||||
|
%end;
|
||||||
|
%else %do;
|
||||||
|
proc metadata in= "<GetMetadataObjects>
|
||||||
|
<Reposid>$METAREPOSITORY</Reposid>
|
||||||
|
<Type>Person</Type>
|
||||||
|
<NS>SAS</NS>
|
||||||
|
<!-- Specify the OMI_XMLSELECT (128) flag -->
|
||||||
|
<Flags>128</Flags>
|
||||||
|
<Options>
|
||||||
|
<Templates>
|
||||||
|
<Person Name=""/>
|
||||||
|
</Templates>
|
||||||
|
<XMLSELECT search=""Person[@Name='&user']""/>
|
||||||
|
</Options>
|
||||||
|
</GetMetadataObjects>"
|
||||||
|
out=response;
|
||||||
|
run;
|
||||||
|
%end;
|
||||||
|
|
||||||
filename sxlemap temp;
|
filename sxlemap temp;
|
||||||
data _null_;
|
data _null_;
|
||||||
|
|||||||
Reference in New Issue
Block a user