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 on page 853.

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. Hex values may 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:

click to expand
Display 42.1: 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.

click to expand
Display 42.2: 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:

Example Code 42.1: SAS code for sending a SASUSER registry entry to the log
start example
 proc registry    listuser    startat='  sasuser-registry-key-name  ';  run; 
end example
 
Example Code 42.2: SAS code for sending a SASUSER registry entry to the log
start example
 proc registry    listuser    startat='HKEY_SYSTEM_ROOT\CORE\PRINTING\PRINTERS\PostScript\DEFAULT SETTINGS';  run; 
end example
 

For example, the list below begins at the CORE\PRINTING\PRINTERS\PostScript\DEFAULT SETTINGS key.

Output 42.1: Log Output of a Registry Entry for a PostScript Printer
start example
 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 
end example
 



Base SAS 9.1.3 Procedures Guide (Vol. 1)
Base SAS 9.1 Procedures Guide, Volumes 1, 2, 3 and 4
ISBN: 1590472047
EAN: 2147483647
Year: 2004
Pages: 260

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