|Connecting to Common Data Sources|
|Register the Base SAS Library|
The following figure provides a logical view of accessing a library of SAS data sets.
Establishing Shared Access to SAS Data Sets
After you have installed the required SAS software, you need to set up a connection from a SAS server to a SAS data set. This connection requires that you register the Base SAS library with the SAS Metadata Server. In addition, you must import any user-defined formats that have been created for the data set in order to view or operate on the data. Assume that the SAS software has already been loaded by using the standard installation wizard and that the data set is stored in a location that can be accessed.
Register the library by using SAS Management Console. This metadata enables your SAS applications to access the data sets that you need to work with. For this example, the data set contains information about customers of the Orion Gold enterprise.
To register a Base SAS library, perform the following steps:
In SAS Management Console, expand Data Library Manager. Right-click Libraries. Then, select the New Library option to access the first page of the New Library wizard.
Select SAS BASE Library from the SAS Data list. Click Next.
Enter an appropriate library name in the Name field (for example, Orion Gold Customers). Note that you can supply an optional description if you want. Click Next.
Enter the following library properties:
||C:\SAS\Config\Lev1\SASApp\Data (Enter the fully qualified path to the library. This path is specified differently in different operating systems. Make sure that the appropriate path is displayed in the Selected items field.)|
You can also click Advanced Options to perform tasks such as pre-assignment and setting host-specific and LIBNAME options. Click Next to access the next page of the wizard.
Select one or more SAS servers. The library is available to the server or servers that you select from this list and visible to users of the server. Click Next.
Examine the final page of the wizard to ensure that the proper values have been entered. Click Finish to save the settings.
At this point, you can register tables, as explained in Registering and Verifying Tables. If registering tables fails, check that the user account has host access permission to the path.
|Working with User-Defined Formats|
If you have existing SAS data sets, you might also have a catalog of user-defined formats and informats. You have two options for making these formats available to applications such as SAS Data Integration Studio and SAS Information Map Studio:
Give the format catalog a standard name and place it in an expected location. This is the preferred method.
Create a user-defined formats configuration file, and use the FMTSEARCH system option to point to the format catalog.
To make the format catalog available, in the preferred method, perform the following steps:
Name the format catalog formats.sas7bcat.
Place the catalog in the directory SAS-config-dir\Lev1\SASApp\SASEnvironment\SASFormats.
Alternatively, you can create a user-defined formats configuration file in which you point to the location of the formats catalog.
To make a format catalog available using the alternative method on Windows and UNIX systems, perform the following steps:
To the SAS configuration file SAS-config-dir\Lev1\SASApp\sasv9_usermods.cfg, add the CONFIG system option, and use it to point to the user-defined formats configuration file.
Then, use the FMTSEARCH system option in the same configuration file to point to the format catalog:
In this example, SAS-config-dir\Lev1\Data\orformat is the location of the format catalog, and orionfmt (filename orionfmt.sas7bcat) is the name of the format catalog. If you have more than one catalog to list, leave a space between each catalog name.
Note: On UNIX systems, you must enter the variable name in uppercase. For example, you enter FMTLIB1 instead of fmtlib1.
To make a format catalog available using the alternative method on z/OS systems, perform the following steps:
Add the AUTOEXEC system option to the SAS launch command as shown in the following example.
In this example, startsas.sh is your SAS launch command script, and userfmt.sas is the name of the SAS autoexec file. When you enter the command, you must enter it all on one line.
In the autoexec file, use the LIBNAME statement to assign the format library and the OPTIONS statement to set the FMTSEARCH system option. For example, you might specify the following statements: