Previous Page | Next Page

Maintaining Global Metadata

SAS Library Definitions

A SAS library definition is a metadata record for a SAS library that contains data, views, source code, or other information that is used in the current Warehouse Environment. They are used to generate LIBNAME statements for the corresponding libraries. SAS library definitions are included in the metadata records for data stores, processes, and Jobs in the current Environment. They are required in order to access source data and to load warehouse data stores.


Preparing to Create a SAS Library Definition

At a minimum, after you create a Warehouse Environment, and before you add any groups or data stores, it is recommended that you add any SAS library definitions that will be needed for the first data stores, processes, and Jobs that you will add to the current Environment.

The metadata for SAS library definitions includes a Path field where you specify a pathname for the library. This path must exist, or the LIBNAME statement that is generated from the library definition will not work. You might find it convenient to create the physical paths before you start creating the library definition in SAS/Warehouse Administrator. Then you will know what to enter in the Path field, and you can test the library definition immediately after creating it.

Keep in mind a SAS library definition does not include a host definition. In most cases, in a separate task, you must create a host definition for the host where the library will reside. In the metadata for data stores and other objects, you must specify both the library definition and the host definition for the computer where the library resides.


Example: Creating a Local Library Definition

The following example summarizes how to create a metadata record for a SAS library that is stored on the SAS/Warehouse Administrator host. The appropriate Warehouse Environment is assumed to exist.


Define Library Properties

Display the Define Items Used Globally window, as described in Using the Define Items Used Globally Window.

In the Type panel of the Define Items Used Globally window, click the button beside SAS Libraries. Click Add at the bottom left of the window. A Library Properties window for the library displays for you to enter the appropriate information as follows:

Name

specifies a display name for the SAS library you are creating.

[untitled graphic]

The Name field contains a display name that is appropriate for a source code library: Source Code .

After you have entered a name (and perhaps a description), click the Details tab. The fields on this tab are

Let the SAS System assign the library

specifies who is responsible for assigning this library--you or SAS/Warehouse Administrator.

Do not select Let the SAS System assign the library if you want to control when this library is assigned.

Libref

specifies a libref for the library being defined.

Path

specifies a physical path for the library being defined. For details about specifying pathnames, see Specifying Physical Pathnames in SAS/Warehouse Administrator.

[untitled graphic]

The Let the SAS System assign the library option is selected in the Details tab above.

The Libref field above contains a libref appropriate for a source code library: source .

For a local library, you can often leave the Engine and Options fields blank.

The Path field above contains a relative pathname that is appropriate for a SAS library on a PC: .\toystore_1\Source .

After specifying values in these fields, click OK. The new library definition is added to the list of libraries in the Define Items Used Globally window.


Example: Creating a Remote Library Definition

This example summarizes how to create a metadata record for a SAS library that is not stored on the SAS/Warehouse Administrator host. The appropriate preparation is assumed to have taken place, as described in Preparing to Create a SAS Library Definition.

Keep in mind that the physical path that you specify in this library definition will not resolve until you combine the library definition with a host definition for the computer where the library resides. In the metadata for data stores and other objects, you will specify both the library definition and the host definition for the computer where the library resides.


Define Library Properties

Display the Define Items Used Globally window, as described in Using the Define Items Used Globally Window.

In the Type panel of the Define Items Used Globally window, click the button beside SAS Libraries. Click Add at the bottom left of the window. A Library Properties window for the library displays for you to enter the appropriate information as follows:

Name

enter a display name for the SAS library you are creating.

[untitled graphic]

The Name field contains a display name that is appropriate for a remote source data library: Remote Src Data .

After you have entered a name (and perhaps a description), click the Details tab. The fields on this tab are

Let the SAS System assign the library

specifies who is responsible for assigning this library--you or SAS/Warehouse Administrator.

Libref

specifies a libref for the library being defined.

Path

specifies a physical path for the library being defined. For details about specifying pathnames, see Specifying Physical Pathnames in SAS/Warehouse Administrator.

.

[untitled graphic]

The Let the SAS System assign the library option is selected in the Details tab above.

The Libref field contains a libref appropriate for a remote data source library: remdata .

Note:   Do not specify any values in the Engine field or the Options field on this tab. All remote host information is provided in a separate host definition.   [cautionend]

The Path field above contains a relative pathname that is appropriate for a SAS library on a UNIX machine: ./toy_unx_srcdata .

Note:   In order for the remote library definition to work properly, the pathname entered in the Path field must resolve after connection to the remote computer is established.   [cautionend]

In the metadata for data stores and other objects, you will specify both the library definition and the host definition for the computer where the library resides. A host definition includes a reference to a SAS/CONNECT script. This script starts a session in a particular directory on the remote computer. The library pathname entered in the Path field must resolve from the start directory on the remote computer, as specified by the host definition you plan to use with this remote library definition.

For example, suppose that you plan to use a host definition called unix_1 with the Remote Src Data library definition in the current example. Suppose also that the unix_1 definition included a reference to a SAS/CONNECT script, which started a SAS session on a UNIX computer in the /user/admin1 directory. In that case, the pathname entered in the Path field above must resolve from the /user/admin1 directory on the target UNIX machine.

After specifying the values above, click OK. The new library definition is added to the list of libraries in the Define Items Used Globally window.


Example: Creating a SAS/ACCESS LIBNAME Definition

This example summarizes how to create a metadata record for a SAS/ACCESS LIBNAME definition, which is a special SAS library that can be used to extract source data in DBMS format or to create warehouse data stores in a DBMS.

SAS/Warehouse Administrator uses a SAS/ACCESS LIBNAME definition to generate a SAS/ACCESS LIBNAME statement. Some of the metadata that you specify in the definition corresponds to the options in the LIBNAME statement. For example, a SAS/ACCESS LIBNAME definition specifies a SAS/ACCESS engine--such as Oracle or Sybase--that enables you to access the corresponding DBMS as if it were a SAS library.

A SAS/ACCESS LIBNAME definition also specifies a DBMS connection profile, which includes the DBMS user ID, password, server name, and other connection information used to access the DBMS. These options are passed to DBMS client software, which actually makes the connection to the DBMS.

SAS/ACCESS LIBNAME definitions can be used in ODDs to access source data in DBMS format. By default, for new DBMS data stores, SAS/Warehouse Administrator generates Load Steps that use SAS/ACCESS LIBNAME statements. For details about the SAS/ACCESS LIBNAME statement, see the SAS Language Reference: Dictionary.


Preparing to Create a SAS/ACCESS LIBNAME Definition

Before you create a SAS/ACCESS LIBNAME definition, make the following preparations:


Test SAS/ACCESS Engine Support

SAS/Warehouse Administrator uses a SAS/ACCESS LIBNAME definition to generate a SAS/ACCESS LIBNAME statement. In order for such a statement to work, you must have SAS/ACCESS software, a DBMS client for the target DBMS, and a DBMS connection profile for the target DBMS. To verify that these elements are working, you might want to manually submit a LIBNAME statement similar to the one that SAS/Warehouse Administrator will generate for the SAS/ACCESS LIBNAME definition that you are creating. If your manually submitted statement is successful in connecting to the target DBMS, the statement generated by SAS/Warehouse Administrator will work also.

For example, suppose that you have installed the relevant software and have gathered the following information:

Target DBMS

Oracle

DBMS user name

admin1

DBMS password

ad1min

DBMS connection name

V2o7223.world

On the computer where the SAS/ACCESS LIBNAME statement will be executed, you could then submit a LIBNAME statement such as the following in the SAS Program Editor:

libname mydb oracle user=admin1 pass=ad1min path='V2o7223.world';

The options are specific to the DBMS to which you are connecting. For details about options, see the appropriate chapter in SAS/ACCESS for Relational Databases: Reference. Some of the options in the LIBNAME statement above are specified in the SAS/ACCESS LIBNAME definition. Others are specified in the DBMS connection profile for the target DBMS.


Define SAS/ACCESS LIBNAME Properties

Display the Define Items Used Globally Window, as described in Using the Define Items Used Globally Window.

In the Type panel of the Define Items Used Globally window, click the button beside SAS Libraries. Click Add at the bottom left of the window. A Library Properties window for the library displays for you to enter the appropriate information as follows:

Name

enter a display name for the SAS library you are creating.

[untitled graphic]

The Name field contains a display name that is appropriate for a SAS/ACCESS LIBNAME definition for an Oracle database: SAS/Oracle Lib .

After you have entered a name (and perhaps a description), click the Details tab. The fields on this tab are

Let the SAS System assign the library

specifies who is responsible for assigning this library--you or SAS/Warehouse Administrator.

Libref

specifies a libref for the library being defined.

Engine

specifies a SAS/ACCESS engine for the library being defined.

[untitled graphic]

The Let the SAS System assign the library option is selected in the Details tab above.

Selecting Let the SAS System assign the library lets SAS/Warehouse Administrator assign this library when you execute a Job that includes a reference to this library definition. Do not select this option if you want to control when this library is assigned.

The Libref field above contains the libref mydb .

The Engine field above specifies that the oracle SAS/ACCESS engine will be used to access this library.

The Options and Path fields are left blank.

Note:   If you are creating a SAS/ACCESS LIBNAME definition, the DBMS user ID, password, and server name should not be entered here in the Options field. That information should be specified as part of the DBMS connection profile that you will specify on the Connection tab.   [cautionend]

After specifying the previous values, click the Connection tab. The fields on this tab are

This library is a database connection library

specifies that the library you are defining requires a DBMS connection profile.

Connection

specifies a DBMS connection profile.

[untitled graphic]

The This library is a database connection library option is selected in the Connection tab above.

In the Connection field, an appropriate DBMS connection profile was selected using the down arrow: oracle-1 . For details about connection profiles, see DBMS Connection Profiles.

After specifying the previous values, click OK. The new library definition is added to the list of libraries in the Define Items Used Globally window.


Example: Creating a Jobs Information Library

If you want SAS/Warehouse Administrator to generate code that will execute a Job at a future date and time, you must define one or more Jobs Information libraries. This example describes how to create a remote Jobs Information library under the control of a SAS/SHARE server, which is the recommended configuration for a production data warehouse in which Jobs are scheduled and tracked through SAS/Warehouse Administrator.

A Jobs Information library is a SAS library that contains status information for Jobs that have been scheduled through the Job Properties window in SAS/Warehouse Administrator. If job tracking is enabled for a given Job, when the Job executes, it will update its status in the appropriate Jobs Information library. The Job Viewer window reads the Jobs Information library to display information about Jobs that have been submitted.


Preparing to Create a Jobs Information Library

The basic steps for creating a Jobs Information library definition are the same as for any SAS library definition: open the appropriate Warehouse Environment and add a library definition from the Define Items Used Globally window. However, there are some special considerations for Jobs Information libraries:

Note:   For a non-production data warehouse, or for a data warehouse where Jobs are not tracked through SAS/Warehouse Administrator, it is not necessary to put the relevant Jobs Information libraries under the control of a SAS/SHARE server. In that case, you can simply add a local or remote library definition, then make that library the Jobs Information library for a given Environment or Data Warehouse, as described in Registering Jobs Information Libraries.  [cautionend]


SAS/SHARE Server Preparation

On the SAS/SHARE server host,

For example, you might create the .\Project-2\_jobinfo_1 directory on the SAS/SHARE server host, then assign the libref joblib_1 to that directory so that it is under the control of the SAS/SHARE server.

Note:   If you use a relative pathname such as .\Project-2\_jobinfo_1 for the Jobs Information library, be sure that the SAS/SHARE server can resolve the pathname.   [cautionend]


SAS/Warehouse Administrator Client Preparation

Verify that your local SAS session can access the remote library that will ultimately become the Jobs Information library that you are creating. One way to do that is to submit a LIBNAME statement for that library. Here is an example of such a statement:

libname joblib_1 server=host2.dwshare;

where joblib_1 is the libref for the Jobs Information library on both the SAS/Warehouse Administrator host and the remote SAS/SHARE server host, host2 is the name of the remote host, and dwshare is the name of the SAS/SHARE server.

If you can successfully execute such a statement, then SAS/Warehouse Administrator can successfully generate code for the remote Jobs Information library.


Define Library Properties

Display the Define Items Used Globally Window, as described in Using the Define Items Used Globally Window.

In the Type panel of the Define Items Used Globally window, click the button beside SAS Libraries. Click Add at the bottom left of the window. A Library Properties window for the library displays for you to enter the appropriate information as follows:

Name

specifies a display name for the SAS library you are creating, such as Joblib_1 .

[untitled graphic]

After you have entered a name (and perhaps a description), click the Details tab. The fields on this tab are

Let the SAS System assign the library

specifies who is responsible for assigning this library--you or SAS/Warehouse Administrator.

Libref

specifies a libref for the library being defined.

Engine

specifies a SAS engine appropriate for the library being defined.

Options

specifies any LIBNAME statement options appropriate for the library being defined.

[untitled graphic]

On the Details tab, the Let the SAS System assign the library option is selected.

The Libref field contains a local libref appropriate for a Jobs Information library: joblib_1 . The current example assumes that the libref for the Jobs Information library is joblib_1 on both the SAS/Warehouse Administrator host and the remote SAS/SHARE server host.

The Engine field specifies the remote engine, because the library in our example is on a host that is remote to SAS/Warehouse Administrator.

The Options field specifies the SERVER= option required to access the Jobs Information library, where host2 is the name of the remote host, and dwshare is the name of the SAS/SHARE server.

After specifying values in these fields, click OK. The new library definition is added to the list of libraries in the Define Items Used Globally window.

After you have defined the library, you can make that library the Jobs Information library for a given Environment or Data Warehouse, as described in Registering Jobs Information Libraries.

Previous Page | Next Page | Top of Page