.SASXREG file
a text file with the file extension .SASXREG that contains the text representation of
the actual binary SAS Registry file.
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 ensure that values are stored properly in the registry when
changing the configuration.
CAUTION:
If you use the Registry Editor to change values, you are not 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
1
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 restores the Sasuser registry to its default settings.
CAUTION:
Do not delete the registry file that is located in Sashelp; this prevents SAS
from starting.
1
The Sashelp part of the registry contains settings that are common to all users at your site. Sashelp is Write protected, and can be
updated only by a system administrator.
224 Chapter 14 The SAS Registry
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 that 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 backup 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 backup, are overwritten and revert to the
backup file values after the restore.
Any existing keys or 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 are
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 names the file
Regstry_copy.
Operating Environment Information
You can also use a copy command from your operating environment to make a
copy of your registry file for backup purposes. When viewed from outside SAS
Explorer, the filename 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.
Managing the SAS Registry 225
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. Enter a name for your registry backup file in the filename field. (SAS applies 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 backup 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.
226 Chapter 14 The SAS Registry
To attempt to repair a damaged registry:
1. Rename the damaged registry file to something other than “registry” (for example,
temp).
2. Start your SAS session.
3. Define a library pointing to the location of the temp registry.
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 whether the changes fixed the problem.
Using the SAS Registry to Control Color
Overview of Colors and the SAS Registry
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), and each component has a range of 00 to FF (0 to 255).
The registry values for color are located in the COLORNAMESHTML subkey.
Adding Colors Using the Registry Editor
You can create your own new color values by adding them to the registry in the
COLORNAMESHTML subkey:
1. Open the SAS Registry Editor using the REGEDIT command.
2. Select the COLORNAMESHTML subkey.
3. Select Edit ð New Binary Value. A pop-up menu appears.
4. Enter the color name in the Value Name field and the RGB value in the Value Data
field.
5. Click OK.
Adding Colors Programmatically
You can create your own new color values by adding them to the registry in the
COLORNAMESHTML subkey, using SAS code.
The easiest way is to first write the color values to a file in the layout that the
REGISTRY procedure expects. Then you import the file by using the REGISTRY
procedure. In this example, Spanish color names are added to the registry.
filename mycolors temp;
data _null_;
file "mycolors";
put "[colornameshtml]";
Managing the SAS Registry 227
put ' "rojo"=hex:ff,00,00';
put ' "verde"=hex:00,ff,00';
put ' "azul"=hex:00,00,ff';
put ' "blanco"=hex:ff,ff,ff';
put ' "negro"=hex:00,00,00';
put ' "anaranjado"=hex:ff,a5,00';
run;
proc registry import="mycolornames";
run;
After you add these colors to the registry, you can use these color names anywhere that
you use the color names supplied by SAS. For example, you could use the color name in
the GOPTIONS statement as shown in the following code:
goptions cback=anaranjado;
proc gtestit;
run;
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. The registry 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. Enter 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.
228 Chapter 14 The SAS Registry
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.50.222