Managing the SAS Registry


Primary Concerns about Managing the SAS Registry

CAUTION:

  • If you make a mistake when you edit the registry, your system might become unstable or unusable. Whenever possible, use the administrative tools, such as the New Library window, the PRTDEF procedure, Universal Print windows , and the Explorer Options window, to make configuration changes, rather than editing the registry. This is to insure values are stored properly in the registry when changing the configuration.

CAUTION:

  • If you use the Registry Editor to change values, you will not be warned if any entry is incorrect. Incorrect entries can cause errors, and can even prevent you from starting a SAS session.

Backing Up the SASUSER Registry

Why Back Up the SASUSER Registry?

The SASUSER [*] part of the registry contains personal settings. It is a good idea to back up the SASUSER part of the registry if you have made substantial customizations to your SAS session. Substantial customizations include the following:

  • installing new printers

  • modifying printer settings from the default printer settings that your system administrator provides for you

  • changing localization settings

  • altering translation tables with TRANTAB.

When SAS Resets to the Default Settings

When SAS starts up, it automatically scans the registry file. SAS restores the registry to its original settings under two conditions:

  • If SAS detects that the registry is corrupt, then SAS rebuilds the file.

  • If you delete the registry file called regstry.sas7bitm, which is located in the SASUSER library, then SAS will restore the SASUSER registry to its default settings.

    CAUTION:

    • Do not delete the registry file that is located in SASHELP; this will prevent SAS from starting.

Ways to Back Up the Registry

There are two methods for backing up the registry and each achieves different results:

Method 1: Save a copy of the SASUSER registry file called regstry.sas7bitm.

  • The result is an exact copy of the registry at the moment you copied it. If you need to use that copy of the registry to restore a broken copy of the registry, then any changes to the registry after the copy date are lost. However, it is probably better to have this backup file than to revert to the original default registry.

Method 2: Use the Registry Editor or PROC REGISTRY to back up the parts of the SASUSER registry that have changed.

  • The result is a concatenated copy of the registry, which can be restored from the backup file. When you create the backup file using the EXPORT= statement in PROC REGISTRY, or by using the Export Registry File utility in the Registry Editor, SAS saves any portions of the registry that have been changed. When SAS restores this backup file to the registry, the backup file is concatenated with the current registry in the following way:

    • Any completely new keys, subkeys or values that were added to the SASUSER registry after the back up date are retained in the new registry.

    • Any existing keys, subkeys or values that were changed after SAS was initially installed, then changed again after the back up, are overwritten and revert to the back up file values after the restore.

    • Any existing keys, subkeys or values that retain the original default values, will have the default values after the restore.

Using the Explorer to Back Up the SAS Registry

To use the Explorer to back up the SAS Registry:

  1. Start SAS Explorer with the EXPLORER command, or select

    View Explorer

  2. Select

    Tools Options Explorer

    The Explorer Options window appears.

  3. Select the Members tab

  4. Select ITEMSTOR in the Type list.

  5. Click Unhide.

    If ITEMSTOR does not have an icon associated with it in the Type list, you will be prompted to select an icon.

  6. Open the Sasuser library in the Explorer window.

  7. Right-click the Regstry.Itemstor file.

  8. Select Copy from the pop-up menu and copy the Regstry file. SAS will name the file Regstry_copy .

    Note: You can also use a copy command from your operating environment to make a copy of your registry file for back up purposes. When viewed from outside SAS Explorer, the file name is regstry.sas7bitm . Under z/OS, you cannot use the environment copy command to copy your registry file unless your SASUSER library is assigned to an HFS directory.

Using the Registry Editor to Back Up the SAS Registry

Using the Registry Editor to back up the SAS registry is generally the preferred backup method, because it retains any new keys or values in case you must restore the registry from the backup.

To use the Registry Editor to back up the SAS Registry:

  1. Open the Registry Editor with the regedit command.

  2. Select the top-level key in the left pane of the registry window.

  3. From the Registry Editor, select

    File Export Registry File

    A Save As window appears.

  4. Type a name for your registry backup file in the filename field. (SAS will apply the proper file extension name for your operating system.)

  5. Click Save.

This saves the registry backup file in SASUSER. You can control the location of your registry backup file by specifying a different location in the Save As window.

Recovering from Registry Failure

This section gives instructions for restoring the registry with a back up file, and shows you how to repair a corrupt registry file.

To install the registry backup file that was created using SAS Explorer or an operating system copy command:

  1. Change the name of your corrupt registry file to something else.

  2. Rename your backup file to regstry.sas7bitm , which is the name of your registry file.

  3. Copy your renamed registry file to the SASUSER location where your previous registry file was located.

  4. Restart your SAS session.

To restore a registry backup file created with the Registry Editor:

  1. Open the Registry Editor with the regedit command.

  2. Select

    File Import Registry File

  3. Select the registry file that you previously exported.

  4. Click Open.

  5. Restart SAS.

To restore a registry backup file created with PROC REGISTRY:

  1. Open the Program editor and submit the following program to import the registry file that you created previously.

     proc registry import=<registry file specification>;  run; 

    This imports the registry file to the SASUSER library.

  2. If the file is not already properly named, then use Explorer to rename the registry file to regstry.sas7bitm:

  3. Restart SAS.

To attempt to repair a damaged registry

  1. Rename the damaged registry file to something other than 'regstry'; for example, temp .

  2. Start your SAS session.

  3. Define a library pointing to where the temp registry is

     libname here '.' 
  4. Run the REGISTRY procedure and redefine the SASUSER registry:

     proc registry setsasuser="here.temp";  run; 
  5. Start the Registry Editor with the regedit command. Select

    Solutions Accessories Registry Editor View All

  6. Edit any damaged fields under the HKEY_USER_ROOT key.

  7. Close your SAS session and rename the modified registry back to the original name.

  8. Open a new SAS session to see if the changes fixed the problem.

Using the SAS Registry to Control Color

The SAS registry contains the RGB values for color names that are common to most web browsers. These colors can be used for ODS and GRAPH output. The RGB value is a triplet (Red, Green, Blue) with each component having a range of 00 to FF (0 to 255).

The registry values for color are located in the COLORNAMES\HTML subkey. You can create your own new color values by adding them to the registry in the COLORNAMES\HTML subkey , using the Registry Editor:

  1. Open the SAS Registry Editor using the REGEDIT command.

  2. Select the COLORNAMES\HTML subkey.

  3. Select

    Edit New Binary Value

    A pop-up menu appears.

  4. Type the color name in the Value Name field and the RGB value in the Value Data field.

  5. Click OK.

Using the Registry Editor

When to Use the Registry Editor

The best way to view the contents of the registry is using the Registry Editor. The Registry Editor is a graphical alternative to PROC REGISTRY, an experienced SAS user might use the Registry Editor to do the following:

  • View the contents of the registry, which shows keys and values stored in keys.

  • Add, modify, and delete keys and values stored in the registry.

  • Import registry files into the registry, starting at any key.

  • Export the contents of the registry to a file, starting at any key.

  • Uninstall a registry file.

  • Compare a registry file to the SAS registry.

Many of the windows in the SAS windowing environment update the registry for you when you make changes to such items as your printer setting or your color preferences. Because these windows update the registry using the correct syntax and semantics, it is often best to use these alternatives when making adjustments to SAS.

Starting the Registry Editor

To run the Registry Editor, issue the regedit command on a SAS command line. You can also open the registry window by selecting

Solutions Accessories Registry Editor

Finding Specific Data in the Registry

In the Registry Editor window, double-click a folder icon that contains a registry key. This displays the contents of that key.

Another way to find things is to use the Find utility.

  1. From the Registry Editor, select

    Edit Find

  2. Type all or part of the text string that you want to find, and click Options to specify whether you want to find a key name , a value name , or data .

  3. Click Find.

click to expand
Display 16.2: The Registry Editor Find Utility

Changing a Value in the SAS Registry

CAUTION:

  • Before modifying registry values, always back up the regstry.sas7bitm file from SASUSER.

  1. In the left pane of the Registry Editor window, click the key that you want to change. The values contained in the key appear in the right pane.

  2. Double-click the value. The Registry Editor displays several types of windows, depending on the type of value you are changing.

click to expand
Display 16.3: Example Window for Changing a Value in the SAS Registry

Adding a New Value or Key to the SAS Registry

  1. In the SAS Registry Editor, right-click the key that you want to add the value to.

  2. From the pop-up menu, select the New menu item with the type that you want to create.

  3. Enter the values for the new key or value in the window that is displayed.

click to expand
Display 16.4: Registry Editor with Pop-up Menu for Adding New Keys and Values

Deleting an Item from the SAS Registry

From the SAS Registry Editor:

  1. Right-click the item that you want to delete.

  2. Select Delete from the pop-up menu and confirm the deletion.

Renaming an Item in the SAS Registry

From the SAS Registry Editor:

  1. Right-click the item you want to rename.

  2. Select Rename from the context menu and enter the new name.

Displaying the SASUSER and SASHELP Registry Items Separately

After you open the Registry Editor, you can change your view from the default, which shows the registry contents without regard to the storage location. The other registry view displays both SASUSER and SASHELP items in separate trees in the Registry Editor's left pane.

  1. Select

    TOOLS Options Registry Editor

    This opens the Select Registry View group box.

  2. Select View All to display the SASUSER and SASHELP items separately in the Registry Editor's left pane.

    • The SASHELP portion of the registry will be listed under the HKEY_SYSTEM_ROOT folder in the left pane.

    • The SASUSER portion of the registry will be listed under the HKEY_USER_ROOT folder in the left pane.

click to expand
Display 16.5: The Registry Editor in View Overlay Mode

Importing a Registry File

You usually import a registry file, or SASXREG file when you are restoring a back-up registry file. A registry file can contain a complete registry or just part of a registry.

To import a registry file using the SAS Registry Editor:

  1. Select

    File Import Registry File

  2. In the Open window, select the SASXREG file to import.

Note: In order to first create the back-up registry file, you can use the REGISTRY Procedure or the Export Registry File menu choice in the Registry Editor.

Exporting or Save a Registry File

You usually export a registry file or SASXREG file, when you are preparing a back-up registry file. You can export a complete registry or just part of a registry.

To export a registry file using the SAS Registry Editor:

  1. In the left hand pane of the Registry Editor, select the key you want to export to a SASXREG file. To export the entire registry, select the top key.

  2. Select

    File Export Registry File

  3. In the Save As window, give the export file a name.

  4. Click Save.

When to Use PROC REGISTRY

Use PROC REGISTRY to modify the registry using a SAS program. PROC REGISTRY has basically the same functionality as the Registry Editor in a noninteractive mode. For detailed information about PROC REGISTRY, see Base SAS Procedures Guide .

[*] The SASHELP part of the registry contains settings that are common to all users at your site. SASHELP is write protected, and can only be updated by a system administrator.




SAS 9.1 Language Reference. Concepts
SAS 9.1 Language Reference Concepts
ISBN: 1590471989
EAN: 2147483647
Year: 2004
Pages: 255

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net