Proc Import from SPSS

2019-08-23 02:54发布

Relatively new to SAS and I'm using proc import on an SPSS (.sav) data file and it runs fine but I noticed that it brings in only the SPSS value labels rather than the numeric equivalent. As an example in the Gender column 1='male', 2='female' and in the SAS data set 'male' and 'female' show up rather than 1 or 2.

Any insight would be appreciated. Current code...

 proc import datafile = "C:\Data\workload_20130314.sav"
     out=library.workload_20130314
     dbms = sav
     replace;
 run;

标签: sas
1条回答
放荡不羁爱自由
2楼-- · 2019-08-23 03:31

You probably have the underlying values there, they're probably just formatted. Try opening the dataset and viewing the column properties of one of the columns you're looking at; it probably has a format that's like Q49F. or something that does that. It still works with PROC MEANS or whatever as a numeric variable.

You can run, I think, something like

proc datasets;
modify my_dataset;
format _all_;
quit;

to remove the overlay. You can also do that on a case by case basis.

查看更多
登录 后发表回答