Previous Page | Next Page

The REGISTRY Procedure

Creating Registry Files with the REGISTRY Procedure


Structure of a Registry File

You can create registry files with the SAS Registry Editor or with any text editor.

A registry file must have a particular structure. Each entry in the registry file consists of a key name, followed on the next line by one or more values. The key name identifies the key or subkey that you are defining. Any values that follow specify the names or data to associate with the key.


Specifying Key Names

Key names are entered on a single line between square brackets ([ and ]). To specify a subkey, enter multiple key names between the brackets, starting with the root key. Separate the names in a sequence of key names with a backslash (\). The length of a single key name or a sequence of key names cannot exceed 255 characters (including the square brackets and the backslashes). Key names can contain any character except the backslash.

Examples of valid key name sequences follow. These sequences are typical of the SAS registry:

[CORE\EXPLORER\MENUS\ENTRIES\CLASS]

[CORE\EXPLORER\NEWMEMBER\CATALOG]

[CORE\EXPLORER\NEWENTRY\CLASS]

[CORE\EXPLORER\ICONS\ENTRIES\LOG]


Specifying Values for Keys

Enter each value on the line that follows the key name that it is associated with. You can specify multiple values for each key, but each value must be on a separate line.

The general form of a value is:

value-name=value-content

A value-name can be an at sign (@), which indicates the default value name, or it can be any text string in double quotation marks. If the text string contains an ampersand (&), then the character (either uppercase or lowercase) that follows the ampersand is a shortcut for the value name. See Sample Registry Entries.

The entire text string cannot contain more than 255 characters (including quotation marks and ampersands). It can contain any character except a backslash (\).

Value-content can be any of the following:

The following display shows how the different types of values that are described above appear in the Registry Editor:

Types of Registry Values, Displayed in the Registry Editor

[Types of Registry Values, Displayed in the Registry Editor]

The following list contains a sample of valid registry values:


Sample Registry Entries

Registry entries can vary in content and appearance, depending on their purpose. The following display shows a registry entry that contains default PostScript printer settings.

Portion of a Registry Editor Showing Settings for a PostScript Printer

[Portion of a Registry Editor Showing Settings for a PostScript Printer]

To see what the actual registry text file looks like, you can use PROC REGISTRY to write the contents of the registry key to the SAS log, using the LISTUSER and STARTAT= options.

The following example shows the syntax for sending a SASUSER registry entry to the log:

proc registry 
     listuser
     startat='sasuser-registry-key-name';
run;

The following example shows a value for the STARTAT= option:

proc registry
     listuser
     startat='HKEY_SYSTEM_ROOT\CORE\PRINTING\PRINTERS\PostScript\DEFAULT SETTINGS'; 
run;

In the following example, the list of subkeys begins at the CORE\PRINTING\PRINTERS\PostScript\DEFAULT SETTINGS key.

Log Output of a Registry Entry for a PostScript Printer

NOTE: Contents of SASUSER REGISTRY starting at subkey [CORE\
PRINTING\PRINTERS\PostScript\DEFAULT SETTINGS key]

  Font Character Set="Western"
  Font Size=double:12
  Font Style="Regular"
  Font Typeface="Courier"
  Font Weight="Normal"
  Margin Bottom=double:0.5
  Margin Left=double:0.5
  Margin Right=double:0.5
  Margin Top=double:0.5
  Margin Units="IN"
  Paper Destination=""
  Paper Size="Letter"
  Paper Source=""
  Paper Type=""
  Resolution="300 DPI"
NOTE: PROCEDURE REGISTRY used (Total process time):
      real time           0.03 seconds
      cpu time            0.03 seconds

Previous Page | Next Page | Top of Page