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:

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:
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. For more information, 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 string double: followed by a numeric value.
  • a string. You can put anything inside the quotes, including nothing ("").
    Note: To include a backslash in the quoted string, use two adjacent backslashes. To include a double quotation mark, use two adjacent double quotation marks.
  • the string hex: followed by any number of hexadecimal characters, up to the 255-character limit, separated by commas. If you extend the hexadecimal characters beyond a single line, then end the line with a backslash to indicate that the data continues on the next line. Hexadecimal values can also be referred to as “binary values” in the Registry Editor.
  • the string dword: followed by an unsigned long hexadecimal value.
  • the string int: followed by a signed long integer value.
  • the string uint: followed by an unsigned long integer value.
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:
  • a double value=double:2.4E-44
  • a string="my data"
  • binary data=hex: 01,00,76,63,62,6B
  • dword=dword:00010203
  • signed integer value=int:-123
  • unsigned integer value (decimal)=dword:0001E240

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
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
The following example shows a value for the STARTAT= option:
proc registry
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\

  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"