SAS Data Files

Stat/Transfer will read and write SAS Version 6 - 9 data files for the Windows,  OS/2 and Unix platforms.   Version 6.04 for PC/DOS can be read, but not written.

 

Standard extensions:

Version 6

 

     PC/DOS

ssd

     Windows & OS/2 

sd2

     Unix  HP/Sun/IBM

ssd01

Version 7 - 9

sas7bdat

 

Reading and Writing SAS Data Files

Large files (> 2 GB) are now supported on both input and output.

 

The number of variables is unlimited.

 

Both 32 and 64 bit files are supported on input and output.

 

Read and write support for the maximum character variable length (32K) has been added.

 

Reading SAS Data Files

Stat/Transfer will read data files written by SAS Version 6.08 and above.

 

Compressed files (both RDC & RLE) for Version 7 and higher can be read.

 

SAS data files differ significantly between platforms.  Stat/Transfer will read files written by SAS for all SAS platforms except for VAX VMS and IBM MVS.

 

Stat/Transfer will automatically recognize the type of SAS file on input.

 

If you are moving SAS data files between platforms, you should be sure that you use a binary file transfer method.

 

User formats (value labels) can be directly read from Windows SAS catalogs and CPORT files.  Thus, there is no longer any need to convert these to data sets in order to read formats.

 

However, in all other cases, the catalog file is not read directly and value labels must therefore be transferred to the data file according to the procedure described in SAS Value Labels.

 

Options to control the reading of formats are set in the Reading SAS Value Labels section of the Options dialog box.

 

Writing SAS Data Files

On output, Stat/Transfer will write files for all SAS platforms except for VAX VMS and IBM MVS.

 

When you select SAS as the output type, you now have an option to control the "data representation" of the output SAS dataset. The possible data representations correspond to sixteen of the values for OUTREP= in the SAS system.

 

The SAS data representation that will be used for the output file will appear next to the Output File Type box. If this is not the data representation that you wish to write, use the SAS Data Representation option in the Output Options(1) section of the Options dialog box and make the appropriate selection from the drop-down list.

 

When writing SAS data files, you should pick an output format that is appropriate for the version of SAS that will be reading the file.

 

Value labels can be transferred according to the output procedure described in SAS Value Labels.

 

SAS date, time, and datetime formats can be controlled by options on the "SAS-Writing" tab.

 

Missing Data

SAS supports the missing values 'A' - 'Z', '.' and '._'.

 

Input

On input, when a SAS file is transferred to a Stata file or an ASCII file with extended missing values specified, the SAS input missing values will be transferred to the equivalent ones in the output file, with the exception that any missing values '._' in the input SAS file will be written out as '.' in the output

 

For all other output formats, all of SAS's missing values are converted to a single internal missing value in Stat/Transfer.

 

Output

When either an ASCII file or a Stata file with extended missing values is transferred to a SAS file, the input missing values will transfer to the equivalent SAS ones.  For other file formats, on output to SAS, missing values are set to '.', the SAS standard missing value.

 

For input files that support user missing values (SPSS and OSIRIS), the options User Missing Value and Map to extended (a-z) missing in the User Missing Values section of the Options dialog box can be used to map selected user missing values to extended missing values in the SAS output file.

 

For all other file formats, on output to SAS missing values are set to '.', the SAS standard missing value.

 

Output Variable Types

The output variable type that results from each target variable type is given in the following table:

 

 

Target Type

Output Type

 

byte

SAS Number - width three bytes

 

int

SAS Number - width four bytes

 

long 

SAS Number - width six bytes

 

float

double

SAS Number - width eight bytes

 

string

SAS Character variable (maximum length of 200 bytes

 

date

SAS Serial Date Number

 

time

SAS Time (number of seconds since midnight)

 

date/time

SAS Datetime (in seconds