Chapter Contents

Previous

Next
SAS Companion for the CMS Environment

Accessing SPSS Files

The SPSS engine is a READ-only engine that enables you to access SPSS files as if they were SAS data files. Both the SPSS Release 9 (and prior releases) and the SPSS-X file formats (both native and import/export) are supported. The engine determines which format is used and reads the file accordingly.

This engine can read only SPSS save files that are created in CMS and OS/390 operating environments. For example, SPSS files that were created in an OpenVMS operating environment cannot be read with the SPSS engine under CMS. The exception is an SPSS import file, which can originate from any operating environment.

The engine automatically determines which type of SPSS file it is reading.


Assigning a Libref to an SPSS File

To assign a libref to an SPSS file so that you can access it, use this form of the LIBNAME statement:

LIBNAME libref SPSS physical-name;

This form of the LIBNAME statement takes the following arguments:

libref
is a SAS libref.

SPSS
specifies the SPSS engine.

physical-name
specifies the physical location of the library.

The LIBNAME statement has no options for the SPSS engine.

You do not need to use a LIBNAME statement before running PROC CONVERT on an SPSS file.


Referencing SPSS Files

SPSS files created under Release 9 or prior releases have filenames. You should use the filename as the member name in your SAS programs. You can also use _FIRST_ in your SAS programs to refer to the first save file.

SPSS-X save files do not have names. Therefore, you can use a member name of your choice in SAS programs for SPSS-X save files. You can also use _FIRST_ with a save file created under SPSS-X or under SPSS Release 9, because save files under these releases have only one logical member per file.


Example of Accessing SPSS Files

Suppose you want to read the physical file TEMP SPSSDATA. The following statements assign a libref to the physical file, then run PROC CONTENTS and PROC PRINT on the SPSS file:

libname xxx spss 'temp spssdata';
proc contents data=xxx._first_;
proc print data=xxx._first_;


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.