Page One

Campus Computing News

Computing Services for UNT Students: An Update

EduTex: It's Almost Time

Your (PRAS) Time May Be Up

Helpdesk to the Rescue!

Today's Cartoon

RSS Matters

SAS Corner

The Network Connection

Link of the Month

WWW@UNT.EDU

Short Courses

IRC News

Staff Activities

Subscribe to Benchmarks Online
    
Research and Statistical Support

SAS Corner

By Dr. Karl Ho, Research and Statistical Support Services Manager

Data Capability: Data Engines

In the previous two articles, I wrote about how SAS reads OSIRIS data and moves mainframe data to other platforms. In this article, I briefly introduce SAS' data capability in reading and converting data from and to other formats such as SPSS and Excel. The key to opening doors to these other data products is called engines.  

SAS engines are "sets of internal instructions that SAS uses to read from and write to files". The engine identifies the set of routines that the SAS System uses to access the files in the data library. With this architecture, data can reside in different types of files, including SAS data files and data formatted by other software products, such as SPSS, BMDP and other database management systems. For SAS data files, native library engines can be used to access data generated in different versions. Examples are V8 (current), V7 and V6. An XPORT engine is also available for converting all versions of data to transport files for moving to other platforms. For other formats, SAS handles them using data I/O engines, which "interface" data from SAS to other format or the other way around.  

You can specify engine types in the libname statement:

LIBNAME LIFREF engine "path\(filename)";

By default, if no engine type is specified, the V8 BASE engine is used. Note that when the native library engine is used (V8, V7 or V6 except XPORT), the path is the directory is specified (e.g. c:\temp; \usr\data\). But when used with the I/O or XPORT engines, you need to specify the filename with full path (e.g. c:\temp\country.por; \usr\data\country.dat). We have discussed earlier the use of the OSIRIS engine for reading in mainframe OSIRIS data into SAS. I will give some more examples in this article on the SPSS and XPORT engines.

Reading SPSS data

The SPSS engine is designed for reading in SPSS portable data directly into SAS without transformation.

This can also be achieved by using the PROC CONVERT procedure:

The same two programs can be used for reading BMDP data, just by changing the engine and file names.

XPORT engine

This special engine is designed to convert SAS data to transport file format that can be used for moving data to other platforms or statistical package.  The syntax is:

libname source 'c:\DATA';
libname xportout xport 'c:\temp\country.transport';
proc copy in=source out=xportout memtype=data;
SELECt TEST;
run;

where TEST is the SAS data file under the SOURCE library and the new transport file, COUNTRY.TRANSPORT will be created under C:\TEMP.

PROC EXPORT

There is another procedure that performs similar functions.  PROC EXPORT converts SAS data into such other formats as Excel or Lotus spreadsheet, MS Access table or delimited data file. The following sample program converts a SAS data set into a tab-delimited data file c:\temp\test2.txt.

proc export data=test outfile='c:\temp\test2.txt' replace dbms=tab;
run;


Data Entry Helps With Surveys

Let Data Entry set up your survey with out Teleform software. Teleform software allows surveys to be scanned into a PC with a scanner, verified and then exported to a database such as Excel or SPSS. This saves time because the data does not have to be manually entered. Just bring Data Entry a rough draft of your survey. We then create the survey for you using our Teleform software. If you are interested in doing this, please call us at 940-565-3887 or 940-565-3894.