Chapter Contents |
Previous |
Next |
SAS Companion for the Microsoft Windows Environment |
What Is a SAS File? |
The SAS System creates and uses a variety of specially structured files called SAS files. Although Windows manages the file for the SAS System by storing it, the operating system cannot process it. For example, you can list SAS files with the Windows Explorer, but you cannot use the Windows Notepad to edit SAS files. SAS files are different from external files. While external files can be processed by SAS statements and commands, they are not managed by the SAS System.
SAS files usually reside in SAS data libraries. Under Windows, a SAS library is simply a named collection of SAS files within one or more Windows folders that the SAS System can access. Each SAS data library has an access engine associated with it the first time that a file in the library is accessed. The engine name specifies the access method that the SAS System uses to process the files in the data library. SAS data libraries are described in detail in SAS Language Reference: Dictionary.
Various engines enable the SAS System to access different formats or versions of SAS files and other vendors' files. For this reason, the SAS System is said to have Multiple Engine Architecture. Multiple Engine Architecture, combined with conversion utilities, provides access to Version 8 files and SAS files created with previous releases of the SAS System (back to Version 5), whether they were created under Windows or other operating systems. Multiple Engine Architecture also provides access to files created by other vendors' products, including database files.
The following sections highlight information you need in order to create and use SAS files with the various engines under Windows.
Types of SAS Files |
SAS files are stored in SAS data libraries and are referred to as members of a library. Each member has a member type. The SAS System distinguishes between SAS files and external Windows files in a folder by using unique file extensions. The SAS System assigns certain file extensions to a general set of SAS member types. Windows File Extensions and Their Corresponding SAS Member Types lists the Windows file extensions and their corresponding SAS member types for the V6, V7, and V8 engines. For more information about engines, see Multiple Engine Architecture.
V6 File Extension | V7 and V8 File Exension (Short) | V7 and V8 File Extension (Long) | SAS Member Type | Description |
---|---|---|---|---|
.sas | .sas | .sas | none | SAS program |
.ss2 | .ss7 | .sas7bpgm | Program | stored program (DATA step) |
.lst | .lst | .lst | none | output file |
.log | .log | .log | none | log file |
none | .st7 | .sas7baud | Audit | audit file |
.sd2 | .sd7 | .sas7bdat | Data | data set |
.sv2 | .sv7 | .sas7bvew | View | data set view |
.si2 | .si7 | .sas7bndx | Index | data set index. Indexes are stored as separate files but are treated by the SAS System as integral parts of the SAS data file. |
.sc2 | .sc7 | .sas7bcat | Catalog | SAS catalog |
.sa2 | .sa7 | .sas7bacs | Access | access descriptor file |
.sf2 | .sf7 | .sas7bfdb | FDB | consolidation database file |
.sm2 | .sm7 | .sas7bmdb | MDDB | multi-dimensional database file |
none | .s7m | .sas7bdmd | DMDB | data mining database file |
none | .sr7 | .sas7bitm | Itemstor | item store file |
.su2 | .su7 | .sas7butl | Utility | utility file |
.sp2 | .sp7 | .sas7bput | Utiltiy | permanent utility |
.stx | .stx | none | none | transport file |
none | .sb7 | .sas7bbak | none | backup file |
Edit | Rename... |
Note: You may see files with other file extensions in your WORK and SASUSER data libraries. Most of these are temporary utility files that you do not need to access directly; be sure not to delete any of them during your SAS session.
If for some reason your SAS session ends abnormally,
you might need to delete these files, outside of the SAS System, in order
to regain disk space.
You can specify whether the library supports short or long file extensions on the LIBNAME statement. For example, if your SAS library is on a server mapped as the S drive and the server file system supports only short file extensions, your libname statement would look similar to this:
libname mylib 's:\sasv6' shortfileext;For information on specifying short or long file extensions using the LIBNAME statement, see LIBNAME.
If SAS is not
able to create a file with a long file
extension the first time it writes to a library, then the library supports
only files with short file extensions. If you specify a file with a long file
extension for a library that supports only short file extensions, an error
message informs you that the member name is too long for the system.
Logically, a SAS data set consists of two types of information: descriptor information and data values. The descriptor information includes such things as data set name, data set type, data set label, and number of variables, as well as the names and labels of the variables in the data set, their types (character or numeric), their length, their position within a record, and their formats. The data values contain values for the variables. A SAS data set can be visualized as a table consisting of rows of observations and columns of variable values. SAS Data Set Model illustrates the SAS data set model.
The second type of data file is the interface SAS data file. These files store data in a file formatted by other software. Examples of interface SAS data files are BMDP, OSIRIS and SPSS files, which the SAS System can access as read-only files. For more information, see Reading BMDP, OSIRIS and SPSS Files.
In most cases, the maximum file size for a SAS data set is 2 gigabytes (GB). However, if you run the SAS System under Windows NT and store your data on a volume formatted with the Windows NT file system (NTFS), you can create and store data sets larger than 2GB. For more information about this feature and its uses, see Using Large Data Sets with Windows NT and NTFS.
For information about the size limitation of a data set under Windows, see Length and Precision of Variables under Windows.
Views may be of two kinds, native or interface. A native SAS data view is created with the SQL procedure or with the DATA step and describes a subset or combination of the data in one or more SAS data files or SAS data views. For information on SQL views, see the SAS Procedures Guide. For information on DATA step views, see SAS Language Reference: Dictionary.
Interface SAS data views contain descriptor information for data formatted by other software products, for example, a database management system. Such a view is created with the ACCESS procedure in SAS/ACCESS software. For more information, see SAS/ACCESS Software for PC File Formats: Reference and other available SAS/ACCESS documentation.
If you want to use Version 8 to access catalogs created with earlier releases of the SAS System for Windows 95 or Windows NT, you must first convert the catalogs from the earlier releases to Version 8 format before you can use them in a Version 8 SAS program.
For more information on how to convert SAS catalogs,
see Moving and Accessing SAS Files across Operating Environments.
Using Large Data Sets with Windows NT and NTFS |
Note that while you can access the full data set from SAS under Windows NT, other users running SAS under Windows 95 are able to access only the first 2 gigabytes (thus causing unpredictable results).
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.