Using a Metadata Server with the SAS Object Manager

Connecting to Metadata

Before you can use server metadata, you must first connect to a metadata server by using a metadata configuration file. For more information, see Metadata Configuration Files.
If you created your configuration files by using the ITConfig utility, then the SAS Object Manager connects to the metadata server automatically when you call a method or interface that requires metadata.
If your configuration files are not in the default location and the location is not stored in the Windows registry, then you must specify the location by using the SetMetadataFile method. The SetMetadataFile method has three parameters: the full path to the system configuration file, the full path to the user configuration file (optional), and a flag that indicates whether to store the file path values in the registry.
Note: An application should call the SetMetadataFile method one time only. To create a new metadata server connection, use the CreateOMRConnection method.
Note: The user ID that is used to log on to SAS is determined when the object is launched. After the object is launched, the user ID cannot be changed.

Metadata Caching

When a metadata server connection is established, the metadata is read from the server and stored by the SAS Object Manager in a cache. The cached metadata is used when you call CreateObjectByLogicalName, ServerDefs, or LoginDefs.
You can use the SetRepository method to refresh the metadata from the current metadata repository or read metadata from a new repository. For details about the SetRepository method, see the SAS Object Manager reference documentation (sasoman.chm).
For threaded applications, using the metadata cache in the SAS Object Manager causes performance issues. The CreateObjectByOMR method enables you to read metadata from the server without caching the metadata.

Object Definitions

There are three definitions that are useful for defining IOM objects. These definitions can be created either in the source code or on the metadata server:
Server definition (ServerDef)
must be created before an IOM server can be launched using the SAS Object Manager. The server definition can either be loaded from a metadata server or created dynamically. The server definition is independent of the user. Server definitions include a Logical Name attribute.
Login definition (LoginDef)
contains user-specific information, including user name, password, and domain. Login definitions are a convenience and are not required for creating a connection to an IOM server. They provide a mechanism for storing persistent definitions of user names and passwords.
LoginDefs also allow multiple definitions for the same user on different security domains. For example, you could use one user name and password on z/OS and a different one for UNIX.
Logical name definition (LogicalNameDef)
corresponds to a logical server name on the SAS Metadata Server.
For each type of definition, a corresponding container interface enables you to manage the definitions. For example, ServerDef objects are managed by using the ServerDefs interface. You can use the Item method to retrieve definitions by name.