/** @file mm_getusers.sas @brief Creates a table containing a list of all users @details Only shows a limited number of attributes as some sites will have a LOT of users. Usage: %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 @returns outds dataset containing all users, with the following columns: - uri - name @param user= (0) Set to a metadata user to filter on that user @param outds= (work.mm_getusers) The output table to create @version 9.3 @author Allan Bowe **/ %macro mm_getusers( outds=work.mm_getusers, user=0 )/*/STORE SOURCE*/; filename response temp; %if %superq(user)=0 %then %do; proc metadata in= ' $METAREPOSITORY Person SAS 0 ' out=response; run; %end; %else %do; filename inref temp; data _null_; file inref; put ""; put "$METAREPOSITORY"; put "Person"; put "SAS"; put ""; put "128"; put ""; put ""; put ''; put ""; length string $10000; string=cats(''); put string; put ""; put ""; run; proc metadata in=inref out=response; run; %end; filename sxlemap temp; data _null_; file sxlemap; put ''; put "/GetMetadataObjects/Objects/Person"; put ""; put ''; put "/GetMetadataObjects/Objects/Person/@Id"; put "characterstring32"; put ''; put "/GetMetadataObjects/Objects/Person/@Name"; put "characterstring256"; put '
'; run; libname _XML_ xml xmlfileref=response xmlmap=sxlemap; proc sort data= _XML_.SASObjects out=&outds; by name; run; filename sxlemap clear; filename response clear; libname _XML_ clear; %mend mm_getusers;