Back to Political Science


Finding Data


Getting Accounts


SAS Questions


SPSS Questions

how to transfer a SAS file from Unix to Win 95/NT


If you create a SAS System file on the Convex machine, you will not be able to simply download it and use it on a local machine running Win 95/NT. Permanent SAS data sets are computer (binary) files rather than text files, and as such they are platform-dependent. In much the same way that Word Perfect for Windows must convert a file you created in Word Perfect for DOS before you can edit it, you must convert the file from Unix to Win 95/NT.

First create a portable file on the Unix machine by running this program:

LIBNAME sasfile location;
LIBNAME tranfile xport 'filename.sasport';
PROC CONTENTS data=sasfile.filename; compare;
PROC FREQ data=sasfile.filename; transer;
tables _all_;
PROC COPY in=sasfile out=tranfile;
select filename;
RUN;

FTP the file to disk or to your folder on the network drive. Remember that this is a binary file, so you'll have to transfer it in binary mode.

On the Win 95/NT machine, run the following program:

LIBNAME tranfile xport 'filename.sasport';
LIBNAME newdata location;
PROC COPY in=tranfile out=newdata;
PROC CONTENTS data=newdata.filename;
PROC FREQ data=newdata.filename;
tables _all_;
RUN;

Compare the results from your PROC CONTENTS and PROC FREQ to make sure that the data transferred correctly.