02.05.2013 Views

SAS(R) 9.1.3 Companion for z/OS

SAS(R) 9.1.3 Companion for z/OS

SAS(R) 9.1.3 Companion for z/OS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Accessing BMDP, SPSS, and <strong>OS</strong>IRIS Files Assigning a Libref to an SPSS File 69<br />

In the next example, the TSO ALLOC command associates a DDname with the name<br />

of the physical file that comprises the BMDP physical-filename. The physical file name<br />

is omitted in the LIBNAME statement and LIBNAME function, because the libref that<br />

is used is the same as the DDname in the TSO statement. The PROC PRINT statement<br />

prints the data <strong>for</strong> the first save file in the physical file.<br />

Accessing SPSS Files<br />

tso alloc f(xxx) da(’my.bmdp.file’) shr reu;<br />

libname xxx bmdp;<br />

proc print data=xxx._first_;<br />

run;<br />

The SPSS engine supports native and portable file <strong>for</strong>mats <strong>for</strong> both SPSS and<br />

SPSS-X files. The engine automatically determines which type of SPSS file it is reading<br />

and reads the file accordingly.<br />

This engine can read only SPSS data files that were created under the same<br />

operating environment. For example, the SPSS engine under z/<strong>OS</strong> cannot read SPSS<br />

files that were created under the OpenVMS operating environment. The only exception<br />

is an SPSS portable file, which can originate from any operating environment.<br />

Assigning a Libref to an SPSS File<br />

In order to access an SPSS file, you must use the LIBNAME statement or<br />

LIBNAME function to assign a libref to the file. Specify the SPSS engine in the<br />

LIBNAME statement as follows:<br />

LIBNAME libref SPSS ’physical-filename ’;<br />

libref<br />

is a <strong>SAS</strong> libref.<br />

SPSS<br />

is the SPSS engine.<br />

physical-filename<br />

is the physical file name of the SPSS file.<br />

The syntax of the LIBNAME function <strong>for</strong> SPSS is as follows:<br />

LIBNAME(libref, ’physical-filename’, ’SPSS’)<br />

You do not need to use a LIBNAME statement or function be<strong>for</strong>e running PROC<br />

CONVERT if you are using PROC CONVERT to convert an SPSS file to a <strong>SAS</strong> data<br />

file. (See “CONVERT Procedure” on page 308.)<br />

Note that the LIBNAME statement and function have no options <strong>for</strong> the SPSS engine.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!