Files Used by SAS


Introduction To Files Used by SAS

SAS uses many files while it is running; however, some of these files are especially important from a user 's perspective. These files include the

  • SAS configuration files (SASV x .CFG by default, where x is the release number)

  • SAS autoexec file (AUTOEXEC.SAS by default)

  • user profile catalog (Profile.sas7bcat)

  • user printer profile catalog (Profile2.sas7bcat)

  • Work data library ('SAS Temporary Files' folder in your system's designated TEMP area)

  • SAS Registry Files.

SAS Configuration Files

Purpose of Configuration Files

The SAS configuration file enables you to specify SAS system options that are used to establish your SAS session. These system options indicate , among other things, the location of your SAS Help and Documentation files as well as the location of message files and the pathnames to SAS executable files. The SAS configuration file is particularly important because it specifies the folders that are searched for the various components of SAS products. You must have at least one configuration file in order for SAS to initialize; you can have multiple configuration files that are all processed while your SAS session begins. For a list of system options that you can use in your SAS configuration file, see 'Summary of System Options for Windows ' on page 470. For more information about system options, see Chapter 22, 'System Options under Windows ,' on page 465 and 'SAS System Options' in SAS Language Reference: Dictionary .

The Default Configuration File

In previous releases of SAS, the default configuration file was stored in the !SASROOT folder. The ! SASROOT folder is the folder in which you install SAS. Starting with SAS 9, SAS creates two default configuration files during installation. Both configuration files are named SASV9.CFG.

SAS stores one of these files in the !SASROOT folder and the other in the !sasroot\nls\ language-code folder. The language-code is a two-letter language code for the SAS default language.

The SASV9.CFG file that is located in the !SASROOT folder contains a CONFIG system option that specifies the location of the configuration file for the SAS default language. The default system options that are used to start SAS are specified in the !sasroot\nls\ language-code \SASV9.CFG file. For example, if SAS is installed in the default folder and the default language is English, the SASV9.CFG file in the !SASROOT folder contains -config "c:\program files\sas\sas 9.1\nls\en\sasv9.cfg" .

SAS requires a configuration file, so you must use a SAS configuration file regardless of whether you are using interactive or batch mode.

SAS uses the default configuration file if you start SAS by double-clicking a registered SAS file type, such as .sas.

For more information about the !SASROOT folder, see 'SAS Default Folder Structure' on page 22.

Specifying System Options in a Configuration File

Any system option may be specified when you start SAS. It is often more convenient to place frequently used system options in a configuration file. The syntax for specifying system options in a SAS configuration file is discussed in 'Syntax for System Options in the SAS Invocation or SAS Configuration File' on page 468.

You can edit the default configuration file to add to or change the system option settings, or you can create your own configuration file. 'Creating a Customized Configuration File' on page 14 discusses how to modify your configuration file.

Your configuration file is divided into two sections. The first section specifies system options that are not updated by the SAS Setup application. The second section is used by the setup application for updating information about where SAS software is installed. The sections are divided by the following warning:

 WARNING:    INSTALL Application edits below this line. User              options should be added above this box comment.              INSTALL Application maintains and modifies the              following options; -SASAUTO, -SASHELP, -SASMSG              -PATH, and -MAPS. It also maintains and modifies              the following CONFIG variables with the -SET option;              INSTALL, USAGE, LIBRARY, SAMPSIO, SAMPSRC, SASCBT,              and SASEXT01--SASEXT50. It preserves all lines above              the line containing 'DO NOT EDIT BELOW THIS LINE'. 

The setup application deletes all data below this warning but does not affect the options that are specified above it. The SET system option defines the following SAS environment variables: SASROOT, SASEXT0, SASFOLDER, MYSASFILES, SASCFG, SASAUTOS, SAMPSIO, SAMPSRC, EISIMAGE, and INSTALL. The setup application appends the following system options below this warning: SASUSER, WORK, HELPLOC, DMSEXP, APPLETLOC, TEXTURELOC, RESOURCESLOC, JREOPTIONS, SASSCRIPT, SASHELP, MSG, and PATH.

CAUTION:

  • To avoid corrupting your configuration file, use a SAS text editor or an ASCII text editor to edit your configuration file. The text editor that you choose to edit the configuration file is important to preserve some of the special character formatting in the file. The recommended method is to edit your configuration file by using a SAS text editor (such as the Enhanced Editor) and save it by using the Save As dialog box. If you do not use a SAS text editor, be sure to use another ASCII text editor (such as Windows Notepad). Do not use a specialized editor such as the WordPad application or Microsoft Word. Using such editors can insert carriage control characters into your configuration file or corrupt the characters that are there.

Creating a Customized Configuration File

When you install SAS, a SASV9.CFG file is created in the !SASROOT\nls\ language-code folder. The language-code is a two-letter language code for the SAS default language. You can specify your own file to act as the configuration file, overriding the default file, SASV9.CFG.

The filename that you choose must follow the file naming conventions for the Windows operating environment. The file extension must be .CFG.

When you use your own configuration file instead of the default configuration file, you must add several required system options. For example, you must either use the SET system option to define the environment variable, !SASROOT, or define SASROOT as a Windows environment variable.

To ensure that all required system options are defined in your configuration file, copy the default file ( !SASROOT\nls\ language-code \SASV9.CFG ) and modify the copy instead of creating your own file from scratch.

You can create a customized configuration file and name the file either SASV9.CFG or .SASV9.CFG in your Windows user profile folder. During SAS invocation, SAS looks for either of these files in the Windows user profile folder if the -CONFIG options is not specified. Under Windows NT, the Windows user profile folder is c:\winnt\Profiles\ username \Personal. Under all other Windows operating environments, the user profile folder is c:\Documents and Settings\ username \My Documents.

Starting SAS with an Alternate Configuration File

When you use a file that is located in a different folder or under a different name as your default configuration file, you must tell SAS where to find the configuration file. Use the CONFIG system option to specify the location of this configuration file. For example, the Target field of the SAS Properties dialog box might contain

 ''c:\program files\sas\sas 9.1\sas.exe -config c:\mysas\mysasconfig.CFG'' 

If SAS cannot find the configuration file, an error message is displayed, and SAS does not initialize.

For more information about the CONFIG system option, see 'Processing Options Specified by Additional CONFIG Options' on page 18 and 'CONFIG System Option' on page 494.

How SAS Finds and Processes Configuration Files

When you invoke SAS, SAS automatically searches several locations for configuration options that can affect your SAS session. SAS looks in the following areas and processes them in this order:

SAS_SYS_CONFIG operation system environment variable

  • This environment variable, if defined, must resolve to a valid configuration file. In a multi-user Windows system, this environment variable would most likely be defined as a system environment variable (instead of as a user environment variable) so that it is processed for all users on that system. Use the SAS_USER_CONFIG user environment variable to specify a user-specific configuration file.

files specified by CONFIG system options

  • In the SAS invocation command, you can specify one or more -CONFIG options with the names of the configuration files that you want to use. You must include a separate -CONFIG option for each file that you want to specify.

SASV x .CFG in the folder where SAS.EXE resides

  • SAS looks for a file that is named SASV x .CFG ( x is the SAS version number) in the folder that contains the SAS.EXE file only if you do not specify a -CONFIG option at SAS invocation. This configuration file contains only a CONFIG system option that specifies the configuration file for the SAS default language.

.SASV x .CFG in the Windows user profile folder

  • SAS looks for a file that is named .SASV x .CFG ( x is the SAS version number) in the Windows user profile folder only if you do not specify a -CONFIG option at SAS invocation. Under Windows NT, the Windows user profile folder is c:\winnt\Profiles\ username \Personal . Under all other Windows operating environments, the Windows user profile is c:\Documents and Settings\ username \My Documents .

SASV x .CFG in the Windows user profile folder

  • SAS looks for a file that is named SASV x .CFG ( x is the SAS version number) in the Windows user profile folder only if you do not specify a -CONFIG option at SAS invocation. Under Windows NT, the Windows user profile folder is c:\winnt\Profiles\ username \Personal. Under all other Windows operating environments, the Windows user profile is c:\Documents and Settings\ username \My Documents.

SASV x .CFG in the current folder

  • SAS looks for a file that is named SASV x .CFG ( x is the SAS version number) in the current folder only if you do not specify a -CONFIG option at SAS invocation.

SAS_USER_CONFIG operating system environment variable

  • This environment variable, if defined, must be a path to a valid SAS configuration file. In a multi-user Windows system, this environment variable would likely be defined as a user environment variable (instead of as a system environment variable) so that it is processed only for the current user on that system. Use the SAS_SYS_CONFIG system environment variable to specify a system-wide configuration file.

SAS_OPTIONS operating system environment variable

  • This environment variable, if defined, contains a string of option specifications for any other SAS system options that you want to process each time that you invoke SAS. For example, this environment variable might contain -obs 2m -sasinitialfolder c:\myfolder -linesize max .

SAS invocation command line

  • You can specify additional system options in the command that you use to invoke SAS. These system options always override option values that are set within any of the configuration files.

If you start SAS from the Windows Start menu, the last configuration file to be processed is the one that is specified in the Start menu shortcut for SAS. The options specified in this configuration file override any options that have previously been processed. By default, the Start menu shortcut specifies -config !SASROOT\nls\ language-code \SASV x .CFG

SAS uses the default configuration file if you start SAS by double-clicking on a registered SAS file type, such as .sas or .sas7bpgm.

Processing Options Specified by Additional CONFIG Options

You can also specify additional -CONFIG options within any configuration file. When SAS encounters a -CONFIG option, SAS immediately processes the options in that named file and then returns to process the remainder of the current file. SAS options that are encountered later in the processing always override those options that are specified earlier. For example, if you specify -ICON in the file that is specified by the SAS_SYS_CONFIG environment variable, and then -NOICON in the file that is specified by the SAS_USER_CONFIG environment variable, the -NOICON option is used. Since the options that you specify in the SAS invocation command are always processed last, those option values will always override the option values that are specified in configuration files. Figure 1.1 on page 17 illustrates the flow of the SAS configuration file processing.

click to expand
Figure 1.1: Order of Processing for SAS Configuration Files

For more information about the CONFIG system option, see 'CONFIG System Option' on page 494.

SAS Autoexec File

Introduction to the SAS Autoexec File

The SAS autoexec file contains SAS statements that are executed immediately after SAS initializes and before any user input is accepted. These SAS statements can be used to invoke SAS programs automatically, set up certain variables for use during your SAS session, or set system options.

Use a SAS text editor to create your autoexec file. The text editor that you choose to create the autoexec file is important. The recommended method is to create the file by using a SAS text editor (such as the Enhanced Editor window) and save it using the Save As dialog box. If you do not use the SAS text editor, be sure to use another ASCII text editor (such as Windows Notepad). Do not use a specialized editor such as the WordPad application or Microsoft Word. Using such an editor can insert special carriage control characters into your autoexec file that SAS cannot interpret when it tries to execute the statements in the file.

The Default Autoexec File

Unlike the configuration file, a SAS autoexec file is not required in order to run SAS. But, if you do have an autoexec file, the default name is AUTOEXEC.SAS. SAS uses the following search order to find the AUTOEXEC.SAS file:

  1. Search the current folder.

  2. Search the paths that are specified by the Windows PATH environment variable.

  3. Search the root folder of the current drive.

  4. Search the folder that contains the SAS.EXE file.

If an AUTOEXEC.SAS file is not present in one of these folders and if you did not specify the -AUTOEXEC option on the command line or within any of your configuration files, then SAS assumes that there is no autoexec file to process. For more information, see 'AUTOEXEC System Option' on page 485.

Locating a Renamed Autoexec File

You do not have to name your autoexec file AUTOEXEC.SAS, but if you name it something else, you must use the AUTOEXEC system option to tell SAS where to find the autoexec file. For example, you can specify the following option after the path specification for the SAS.EXE file in the Target field of the SAS Windows shortcut:

 -autoexec c:\mysasfiles\init.sas 

If the specified autoexec file is not found, an error message is displayed, and SAS terminates.

Uses for the Autoexec File

The autoexec file is a convenient way to execute a standard set of SAS program statements each time that you invoke SAS. You may want to include OPTIONS, LIBNAME, or FILENAME statements, or any other SAS statements and system options that you want the system to execute each time you invoke a SAS session. For example, if you want to specify a script file for SAS/CONNECT software, you can place the following statement in the AUTOEXEC.SAS file:

 filename rlink 'c:\program files\sas\sas 9.1\connect\saslink\startSession.scr'; 

Or you can use the OPTIONS statement to set the page size and line size for your SAS output and use several FILENAME statements to set up filerefs for commonly accessed network drives , as in the following example:

 options linesize=80 pagesize=60;  filename saledata 'f:\qtr1';  filename custdata 'l:\newcust';  filename invoice 'o:\billing'; 

Other system options, in addition to the AUTOEXEC system option, provide ways to send SAS information as it is initializing. These options are listed below in the order in which they are processed:

  1. CONFIG (at SAS invocation only)

  2. AUTOEXEC

  3. INITCMD

  4. INITSTMT

  5. SYSIN

For more information about the CONFIG, AUTOEXEC, INITSTMT, and SYSIN system options, see 'SAS System Options under Windows' on page 467. For more information about the INITCMD system option, see SAS Language Reference: Dictionary .

Suppressing the Autoexec File

If you have an AUTOEXEC.SAS file in your current folder but do not want SAS to use it, specify the NOAUTOEXEC option in the SAS command, as in the following example:

 c:\program files\sas\sas 9.1\sas.exe -noautoexec 

Profile Catalog

Introduction to the Profile Catalog

Each time that you invoke a SAS session, SAS checks the Sasuser data library for your user profile catalog (named Sasuser.Profile), which defines the start-up profile for your SAS session, including key definitions, display configurations, and other personal customizations. If you invoke SAS without accessing an existing profile catalog, SAS creates one with the default key definitions and window configuration.

If Sasuser.Profile does not exist and Sashelp.Profile (in the Sashelp data library) does exist, SAS copies Sashelp.Profile to Sasuser.Profile before invoking a SAS session.

The profile catalog is not re-created if it already exists. Any customizations (such as key definitions or color modifications) that are defined during subsequent sessions are stored in your profile catalog in the specified folder.

The Default Profile Catalog

The default configuration file for SAS specifies the SASUSER system option as follows :

Table 1.2: Default SASUSER location for the Windows Operating Environments

Windows NT

Windows 2000, Windows XP, and Windows Server 2003

  -sasuser   "c:\winnt\Profiles\    username    \   Personal\My SAS Files.1  
  -sasuser "c:\Documents and   Settings\    username    \My Documents\My SAS   Files.1"  
Changing the Location of the Profile Catalog

Use the SASUSER system option to specify a location for the profile catalog other than the default (which is a folder named \My SAS Files\9.1). This option is useful if you want to customize your SAS sessions when sharing a machine with other users or if users are accessing SAS from a network.

The SASUSER system option takes the following form:

-SASUSER (" library-specification ")

Parentheses () are used to specify multiple library-specifications, and quotes (") are used when special characters and spaces are used in the library-specification.

If library-specification (which specifies a valid Windows pathname) does not exist, SAS attempts to create it. For example, if you specify the following option, a profile catalog is created in a folder named MYUSER that resides in the root folder of the C: drive:

 -sasuser "c:\myuser" 

For more information, see 'SASUSER System Option' on page 547.

Deleting the Profile Catalog

When you delete your profile catalog, you lose the key definitions, window configurations, and option settings that you might have defined, as well as any other entries that you saved to your profile catalog. In addition, any text that you stored in NOTEPAD windows is erased. For this reason, it is a good idea to make a backup copy of your profile catalog after making significant modifications to your SAS session settings.

Work Data Library

Introduction to the Work Data Library

SAS requires some temporary disk space during a SAS session. This temporary disk space is called the Work data library . By default, SAS stores SAS files with one-level names in the Work data library, and these files are deleted when you end your SAS session. You can change the Work data library in which SAS files that have one-level names are stored. For more information, see 'Using the User Libref' on page 134.

The Default Work Folder

The default configuration file for SAS specifies the WORK system option to be a folder in your system's designated temporary area (as defined by the TEMP environment variable). For example: !TEMP\SAS Temporary Files .

To determine TEMP environment variable, refer to the System Properties dialog box that you access from the Control Panel.

For more information about using the Work data library and overriding the default location, see 'Using the Work Data Library' on page 133.

Specifying the Location of the Work Data Library

The WORK system option controls the location of the Work data library. You can specify the WORK option in your SAS configuration file or when you invoke SAS. Usually, you use the WORK option that is specified in the default configuration file.

Temporary Subfolders

Because you can run multiple SAS sessions at one time, SAS creates temporary subfolders under the folder that you specify with the WORK option. These temporary subfolders are created in the unique form _TD nnnnnnnnnn , where TD means temporary folder and nnnnnnnnnn is the process ID for each SAS session. These subfolders enable multiple SAS sessions to be invoked, each using the same configuration file, and they prevent the Work folder from being shared. SAS creates any temporary files that are required within each temporary folder. As with all temporary files that are created in the Work data library during a SAS session, these temporary folders are deleted when you end the SAS session. If SAS terminates abnormally, you may need to delete the temporary files.

Deleting the Work Folder

If SAS terminates abnormally, determine if the Work library was deleted. If not, remove it by using Windows commands.

Note: Do not attempt to delete the Work folder while SAS is running.

You can verify the location of the current Work folder by opening the Libraries folder in the SAS Explorer window. Click the right mouse button on the Work folder and select Properties from the pop-up menu.

SAS Registry Files

The SAS registry files are used to store information about the SAS session applications. The registry entries can be customized by using the SAS registry editor or by importing the registry files. To invoke the SAS registry editor, select

Solutions Accessories Registry Editor

CAUTION:

  • Incorrect registry entries can corrupt your SAS registry. Registry customization is generally performed by more advanced users who have experience and knowledge of SAS and their operating environment.

SAS Default Folder Structure

The SAS Setup program creates a number of subfolders during the installation process. Understanding the organization of the SAS folders can help you to use SAS more efficiently .

The root folder of SAS is the folder in which you install SAS. Within SAS, this folder has the logical name !SASROOT. If you use the default provided by SAS, this folder is c:\Program Files\SAS\SAS 9.1 but this is not required. (The examples in this document assume the !SASROOT folder is called c:\Program Files\SAS\SAS 9.1 . )

SAS creates a folder for shared components, such as the Enhanced Editor and images, that are used by other SAS products. For SAS Version 8, the default path for shared components is c:\Program Files\SAS Institute\Shared Files . For SAS 9 and 9.1, the default path for shared files is c:\Program Files\SAS\Shared Files .

One important subfolder of the !SASROOT folder is the CORE subfolder. The CORE subfolder contains many subfolders, three of which are described here:

!SASROOT\CORE\RESOURCE

  • contains SAS resources such as fonts and images.

!SASROOT\CORE\SAMPLE

  • contains the SAS sample programs.

!SASROOT\CORE\SASINST

  • contains the installation process software.

For each SAS product that is installed, the following subfolders might be created (not all products contain all of these folders):

!SASROOT\ product \SASEXE

  • contains the SAS executable files.

!SASROOT\ product \SASHELP

  • contains many specialized catalogs and files.

!SASROOT\ product \SASMACRO

  • contains SAS autocall macro files.

!SASROOT\ product \SASMSG

  • contains the SAS message files.

!SASROOT\ product \SAMPLE

  • contains the Sample Library programs.

!SASROOT\ product \SASTEST

  • contains Test Stream programs.

!SASROOT\ product \SASMISC

  • contains miscellaneous external files shipped with the product.

Some products, such as SAS/CONNECT software, also have other subfolders that are associated with them. For details about each product's structure, see the specific SAS product documentation.

For more information about how the SAS folders are configured at your site, contact your SAS Support Consultant.




SAS 9.1 Companion for Windows
SAS 9.1 Companion for Windows (2 Volumes)
ISBN: 1590472004
EAN: 2147483647
Year: 2004
Pages: 187

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