LIBNAME Statement for the Metadata Engine

Overview: Metadata LIBNAME Statement

To learn how the metadata engine works, see Introduction to the Metadata LIBNAME Engine.
The SAS Metadata Server must be running before you submit the metadata LIBNAME statement. The required SAS library metadata must already exist in the metadata server. (If you specify the METAOUT= Argument with the value "DATA", table metadata is not required.) This SASLibrary metadata can be created with the New Library wizard in the SAS Management Console Data Library Manager.
In the syntax, wherever quotation marks are optional, they can be single or double quotation marks.

Syntax: Metadata LIBNAME Statement

Syntax

LIBNAME libref
META
LIBID=<">identifier<"> | LIBRARY=<">name<"> |
LIBURI="URI-format"
<server-connection-arguments>
<METAOUT=ALL | DATA | DATAREG | META>

Required Arguments

libref
specifies a SAS name that serves as a shortcut name to associate with metadata in the SAS Metadata Repository on the metadata server. This name must conform to the rules for SAS names. A libref cannot exceed eight characters.
META
is the name of the metadata engine.
LIBID=<">identifier<"> | LIBRARY=<">name<"> | LIBURI="URI-format"
specifies a SASLibrary object, which defines a SAS library. This SAS library contains the data that you want to process.
LIBID=<">identifier<">
specifies the 8- or 17-character metadata identifier of the SASLibrary object. Examples are libid=AW000002 and libid="A57DQR88.AW000002". For more information, see Metadata Object Identifiers and URIs.
LIBRARY=<">name<">
specifies the value in the SASLibrary object's Name= attribute. An example is library=mylib. The maximum length is 256 characters.
Alias:LIBRNAME=
LIBURI="URI-format"
specifies a URI, which is a standard from SAS Open Metadata Architecture. For more information, see Metadata Object Identifiers and URIs. The following URI formats are supported.
LIBURI="identifier.identifier"
specifies the full 17–character metadata identifier, which references both the repository and the object. This syntax is equivalent to specifying both LIBID= and REPID=. An example is liburi="A57DQR88.AW000002".
LIBURI="SASLibrary/identifier.identifier"
specifies the SASLibrary object type, followed by the full 17-character metadata identifier. This syntax is equivalent to specifying both LIBID= and REPID=. An example is liburi="SASLibrary/A57DQR88.AW000002".
LIBURI="SASLibrary?@attribute='value'"
specifies the SASLibrary object type, followed by a search string. Examples are liburi="SASLibrary?@libref='mylib'" and liburi=" SASLibrary?@engine='base'".
Requirement:You must enclose the LIBURI= value in quotation marks.

Server Connection Arguments

The following LIBNAME statement arguments for the metadata engine establish a connection to the metadata server. For more information, see Introduction to Connection Options.
METASERVER=<">host-name<">
specifies the host name or network IP address of the computer that hosts the metadata server. The value localhost can be used if the SAS session is connecting to the metadata server on the same computer. If you do not specify this argument, the value of the METASERVER= system option is used. For more information, see METASERVER= System Option. The maximum length is 256 characters.
Alias:HOST= or IPADDR=
PASSWORD=<">password<">
specifies the password for the user ID on the metadata server. If you do not specify this argument, the value of the METAPASS= system option is used. For more information, see METAPASS= System Option. The maximum length is 256 characters.
Alias:METAPASS= or PW=
PORT=<">number<">
specifies the TCP port that the metadata server listens to for connections. This port number was used to start the metadata server. If you do not specify this argument, the value of the METAPORT= system option is used. For more information, see METAPORT= System Option. The range of allowed port numbers is 1–65535. The metadata server is configured with a default port number of 8561.
Alias:METAPORT=
REPID=<">identifier<"> | REPNAME=<">name<">
specifies the repository that contains the SASLibrary object. If you specify both REPID= and REPNAME=, REPID= takes precedence over REPNAME=. If you do not specify REPID= or REPNAME=, the value of the METAREPOSITORY= system option is used; for more information, see METAREPOSITORY= System Option. The default for the METAREPOSITORY= system option is Foundation.
REPID=<">identifier<">
specifies an 8–character identifier. This identifier is the first half of the SASLibrary's 17–character identifier, and is the second half of the repository's identifier. For more information, see Metadata Object Identifiers and URIs.
REPNAME=<">name<">
specifies the value in the repository's Name= attribute. The maximum length is 256 characters.
Alias:METAREPOSITORY= or REPOS= or REPOSITORY=
USER=<">userid<">
specifies the user ID for an account that is known to the metadata server. For information about user definitions, see the SAS Intelligence Platform: Security Administration Guide. If you do not specify this argument, the value of the METAUSER= system option is used; see METAUSER= System Option. The maximum length is 256 characters.
Alias:ID= or METAUSER= or USERID=

METAOUT= Argument

METAOUT=ALL | DATA | DATAREG | META
specifies the metadata engine's output processing of tables in the data source.
ALL
specifies that you can read, create, update, and delete observations in existing physical tables that are defined in metadata. You cannot create or delete entire physical tables. This is the default behavior.
Interaction:The user is restricted to only the tables that have been defined in the repository.
DATA
specifies that you can read, create, update, alter, and delete physical tables. The user can access any table, regardless of whether it has been defined in the repository.
Restriction:The metadata LIBNAME engine does not support variable projection for tables in a third-party DBMS that are not defined in metadata. The engine retrieves all columns for undefined tables, regardless of the operation. If you need to select, insert data into, update, drop, or keep specific columns, register your DBMS tables in the SAS Metadata Repository. Variable projection is supported in Base SAS data sets that are not defined in metadata.
Interaction:The user is not restricted to tables that have been defined in the repository, although there is restricted functionality for tables that are not defined in metadata.
DATAREG
specifies that you can read, update, and delete physical tables that are defined in metadata. You can create a table, but you cannot read, update, or delete the new table until it is defined in metadata. This value is like ALL, but it adds the ability to create new tables.
Interaction:The user is restricted to only the tables that have been defined in the repository.
META
specifies that you can read physical tables that are defined in metadata. You cannot create, update, or delete physical tables or observations. This value is like ALL, without the ability to create, update, and delete observations.
Interaction:The user is restricted to only the tables that have been defined in the repository.
Note:The METAOUT=META value might not be supported in future releases of the software.
Default:ALL
Restriction:The following descriptions refer to the physical table. Metadata is read-only with the metadata engine. When you create, update, or delete physical data with the metadata engine, you must perform an additional step if you want to update the metadata. You must use a product like SAS Management Console or the METALIB procedure to update the metadata.
Interactions: As a LIBNAME statement argument, the behavior applies to all members in the library, and remains for the duration of the library assignment. To specify METAOUT= behavior for an individual table, use the METAOUT= data set option.

If metadata for a table is defined, any authorizations for that table are enforced, regardless of the METAOUT= value.