I'm assuming that you want to get hold of the data and then report/manipulate it in SAS code??
If that's the case try this :
options metaserver="meta1" /* Your metadata server */
metaport=8561
metaprotocol=bridge
metauser="sasadm"
metapass="*****************"
metarepository="Foundation" ; /* Presuming that your users are defined in the Foundation Repository */
data _null_; /* You might need to replace Foundation with an alternate repository name */
length id $20
type $256;
repos_rc=metadata_resolve("omsobj:RepositoryBase?@Name='Foundation'",type,id);
call symputx('reposid', id) ;
call symputx('reposid2', scan(id, 2, ".")) ;
run ;
filename inxml TEMP ; /* defines what metadata you'd like to get hold of */
data _null_ ;
file inxml ;
put
"
" /
" &reposid" /
" Person" /
" " /
" SAS" /
" 404" /
" " /
" " /
" " /
" " /
" " /
" " /
" " /
" " /
" " /
" " /
" " /
" " /
" " /
"" /
;
run ;
filename outxml 'd:\out.xml' ;
proc metadata in=inxml /* Fetches the requested metadata, and returns it as XML */
out=outxml ;
run ;
filename People TEMP ; /* Define an XML map to overlay on your XML */
data _null_ ;
file People ;
put
" " /
"
" /
" " /
" //Person/IdentityGroups/IdentityGroup" /
" " /
" //Person/Logins/Login/@Name" /
" character" /
" string" /
" 200" /
" " /
" " /
" //Person/Logins/Login/Domain/AuthenticationDomain/@Name" /
" character" /
" string" /
" 50" /
" " /
" " /
" //Person/IdentityGroups/IdentityGroup/@Name" /
" character" /
" string" /
" 50" /
" " /
"
" /
"" /
;
run ;
libname outxml xml xmlmap=People access=READONLY; /* Defines a libname containing a table based on your XML map */
/* I'd advise that you copy this table elsewhere before you try to manipulate it, I've seen some odd problems with the XML libname in the past */
Also, you may find this paper useful for future reference (http://www2.sas.com/proceedings/forum2008/134-2008.pdf)
(I've just added some comments to the code)
Message was edited by: simkinp