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. |
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 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. |
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.
To use the Explorer to back up the SAS Registry:
Start SAS Explorer with the EXPLORER command, or select
Select The Explorer Options window appears.
Select the Members tab
Select ITEMSTOR in the Type list.
Click .
If ITEMSTOR does not have an icon associated with it in the Type list, you will be prompted to select an icon.
Open the Sasuser library in the Explorer window.
Right-click the Regstry.Itemstor file.
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 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:
Open the Registry Editor with the regedit command.
Select the top-level key in the left pane of the registry window. 3 From the Registry Editor, select A Save As window appears.
Type a name for your registry backup file in the filename field. (SAS will apply the proper file extension name for your operating system.)
Click .
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.
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:
Change the name of your corrupt registry file to something else.
Rename your backup file to regstry.sas7bitm , which is the name of your registry file.
Copy your renamed registry file to the SASUSER location where your previous registry file was located.
Restart your SAS session.
To restore a registry backup file created with the Registry Editor:
Open the Registry Editor with the regedit command.
Select
Select the registry file that you previously exported.
Click .
Restart SAS.
To restore a registry backup file created with PROC REGISTRY:
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.
If the file is not already properly named, then use Explorer to rename the registry file to regstry.sas7bitm:
Restart SAS.
To attempt to repair a damaged registry
Rename the damaged registry file to something other than "regstry"; for example, temp .
Start your SAS session.
Define a library pointing to where the temp registry is
libname here '.'
Run the REGISTRY procedure and redefine the SASUSER registry:
proc registry setsasuser="here.temp"; run;
Start the Registry Editor with the regedit command. Select
Edit any damaged fields under the HKEY_USER_ROOT key.
Close your SAS session and rename the modified registry back to the original name.
Open a new SAS session to see if the changes fixed the problem.
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:
Open the SAS Registry Editor using the REGEDIT command.
Select the COLORNAMES\HTML subkey.
Select A pop-up menu appears.
Type the color name in the Value Name field and the RGB value in the Value Data field.
Click .
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.
To run the Registry Editor, issue the regedit command on a SAS command line. You can also open the registry window by selecting
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.
From the Registry Editor, select
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 .
Click .
Caution | Before modifying registry values, always back up the regstry.sas7bitm file from SASUSER. |
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.
Double-click the value. The Registry Editor displays several types of windows, depending on the type of value you are changing.
In the SAS Registry Editor, right-click the key that you want to add the value to.
From the pop-up menu, select the New menu item with the type that you want to create.
Enter the values for the new key or value in the window that is displayed.
From the SAS Registry Editor:
Right-click the item that you want to delete.
Select Delete from the pop-up menu and confirm the deletion.
From the SAS Registry Editor:
Right-click the item you want to rename.
Select Rename from the context menu and enter the new name.
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.
Select This opens the Select Registry View group box.
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.
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:
Select
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. |
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:
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.
Select
In the Save As window, give the export file a name.
Click .
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.