Introduction to Procedures for Metadata |
The METAOPERATE procedure and the METADATA procedure perform some of the same tasks. The benefit of PROC METAOPERATE is simpler syntax. The benefit of PROC METADATA is a broader range of tasks (you can submit many different SAS Open Metadata methods). In addition, PROC METADATA creates XML output that you can use in another program (for example, to run reports). In addition, PROC METADATA supports all parameters of the methods it submits, and some of those parameters are not supported by PROC METAOPERATE.
Here is an example that uses PROC METAOPERATE to check whether the metadata server is paused or running:
proc metaoperate action=status; run;
The metadata server returns the following information to the SAS log:
NOTE: Server a123.us.company.com SAS Version is 9.02.02B0P012308. NOTE: Server a123.us.company.com SAS Long Version is 99.02.02B0P01232008. NOTE: Server a123.us.company.com Operating System is XP_PRO. NOTE: Server a123.us.company.com Operating System Family is WIN. NOTE: Server a123.us.company.com Operating System Version is Service Pack 2. NOTE: Server a123.us.company.com Client is janedoe. NOTE: Server a123.us.company.com Metadata Model is Version 11.02. NOTE: Server a123.us.company.com is RUNNING on 11Aug08:15:54:15.
PROC METADATA can perform a similar query with the following code:
proc metadata in=' <Status> <Metadata> </Metadata> </Status>'; run;
The metadata server returns the following information to the SAS log in the form of XML. The status parameters differ slightly from those returned by PROC METAOPERATE.
<Status><Metadata><ModelVersion>11.02</ModelVersion> <PlatformVersion>9.2.0.0</PlatformVersion><ServerState>ONLINE</ServerState> <PauseComment/><ServerLocale>en_US</ServerLocale></Metadata></Status>
PROC METADATA can submit parameters that are not supported by PROC METAOPERATE. Here is an example:
proc metadata in=' <Status> <Metadata> <OMA JournalState=""/> </Metadata> </Status> '; run;
The metadata server returns the journal state:
<Status><Metadata><OMA JournalState="IDLE"/></Metadata></Status>
If you have a simple query that is not supported by PROC METAOPERATE, and you do not want to assign an XML LIBNAME engine to parse the output of PROC METADATA, another choice is the metadata DATA step functions. For more information, see Introduction to DATA Step Functions for Metadata.
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.