getting your metadata using proc metadata n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Getting your metadata using PROC METADATA PowerPoint Presentation
Download Presentation
Getting your metadata using PROC METADATA

Loading in 2 Seconds...

play fullscreen
1 / 13

Getting your metadata using PROC METADATA - PowerPoint PPT Presentation


  • 203 Views
  • Uploaded on

Getting your metadata using PROC METADATA. Edwin J. van Stein Astellas Pharma Global Development Europe. Contents. Example of using PROC METADATA to get group memberships for a specific user from metadata. Preparing for output.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Getting your metadata using PROC METADATA' - zoe-diaz


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
getting your metadata using proc metadata

Getting your metadata using PROC METADATA

Edwin J. van Stein

Astellas Pharma Global Development Europe

contents
Contents

Example of using PROC METADATA to get group memberships for a specific user from metadata

preparing for output
Preparing for output
  • Output written to physical XML file to later convert to SAS data set
  • Encoding of XML file specified to prevent problems with strange characters

filename outgroups

"/sas/user/test/groups.xml"

encoding="utf-8";

setting server connection arguments
Setting server connection arguments
  • SERVER, PORT, USER, PASSWORD and PROTOCOL all default to corresponding system options if not specified
  • USER and PASSWORD (encoded with PROC PWENCODE) set to user with more rights

proc metadata userid="sasadm" password="{sas001}bXkgcGFzc3dvcmQ="

setting output arguments
Setting output arguments
  • Write output to file reference created earlier
  • Output XML to contain a full header

out=outgroups

header=full

xml formatted method call 1
XML-formatted method call (1)
  • Tell the metadata server to get objects
  • From which repository to get objects
  • Type of objects to get
  • Specify namespace

in='<GetMetadataObjects>

<Reposid>$METAREPOSITORY</Reposid>

<Type>Person</Type>

<NS>SAS</NS>

xml formatted method call 2
XML-formatted method call (2)
  • Set flags so that metadata server performs the correct actions:
    • Fill a pre-specified template (flag OMI_TEMPLATE=4)
    • Use an XMLSelect element to filter metadata (flag OMI_XMLSELECT=128)
    • Get the metadata found (flag OMI_GET_METADATA=256)
    • Use XMLSelect element case-sensitive (flag OMI_MATCH_CASE=512)

<Flags>900</Flags>

xml formatted method call 3
XML-formatted method call (3)
  • Both template and XMLSelect element need to be within <Options> tags
  • Only want person and group names returned

<Options>

<Templates>

<Person Name="">

<IdentityGroups />

</Person>

<IdentityGroup Name=""/>

</Templates>

xml formatted method call 4
XML-formatted method call (4)
  • Only return data for persons with a specific name
  • Close open tags to finalize XML-formatted method call

<XMLSelect search="@Name=''Person 1''"/>

</Options>

</GetMetadataObjects>'

putting it all together
Putting it all together

proc metadata userid="sasadm"

password="{sas001}bXkgcGFzc3dvcmQ="

out=outgroups

header=full

in='<GetMetadataObjects>

<Reposid>$METAREPOSITORY</Reposid>

<Type>Person</Type>

<NS>SAS</NS>

<Flags>900</Flags>

<Options>

<Templates>

<Person Name="">

<IdentityGroups />

</Person>

<IdentityGroup Name=""/>

</Templates>

<XMLSelect search="@Name=''Person 1''"/>

</Options>

</GetMetadataObjects>';

run;

next steps
Next steps
  • Explore metadata using 257 as Flag and only setting Type
  • Conversion to data set using an XML map
  • Update metadata
questions
Questions

nl.linkedin.com/in/ejvanstein

ejvanstein@gmail.com