Home > Data Services > Catalog . Restricted Data . Census . ACS

Search Data Services

Meta Search
search across all the following databases:

Data Catalog
Data and documentation

KnowledgeBase
Common questions and answers.

Resources
Entire collection of data resources.


Latest Data News

RSS Feed icon

Lessons from North of the Border

Nerd Alert: Dictionary of Numbers

International Migration Statistics for the US

Open Data Executive Order

Measuring Marriage & Divorce among Same-Sex Couples

Converting a SAS system file on Unix to a SPSS system file for the PC

A. If there is no format to convert:

Step 1: Make a SAS portable data file on the Unix machine.

*Assume ‘child2.ssd01’ is the SAS system file and ‘child2.ptb’ is the portable data file;

libname libin '/usr/work/baxinn/Nepal/sasdata';
libname libout xport '/usr/shared/cathys/child2.ptb';

proc copy in=libin out=libout;
select child2;
run;

Step 2: Read the portable data file to PC SPSS and make a SPSS system file

COMMENT Assume the SPSS system file is ‘child2.sav’

get sas data='t:\cathys\child2.ptb'.

file handle out / name='t:\cathys\child2.sav'.
save outfile=out.
execute .

B. If the format is also converted:

Step 1: Make both data and format portable file on the Unix machine.

* Assume ‘child2.ssd01’ is the SAS system file and ‘child2.ptb’ is the portable data file;
* and ‘fmts.ptb’ is the format catalog;

libname libin '/usr/work/baxinn/Nepal/sasdata';
libname libout1 xport '/usr/shared/cathys/child2.ptb';
libname libout2 xport '/usr/shared/cathys/fmts.ptb';

*Convert the data;

proc copy in=libin out=libout1;
select child2;
run;

*Convert the formats catalog;

proc format library=libin cntlout=fmts;
run;

proc copy in=work out=libout2;
select fmts;
run;
Step 2: Read both the portable data and format files to PC SPSS and make a SPSS system file

COMMENT Assume the SPSS system file is ‘child2.sav’

get sas data='t:\cathys\child2.ptb' /formats=’t:\cathys\fmts.ptb’.

file handle out / name='t:\cathys\child2.sav'.
save outfile=out.
Execute .