Hi,
I imported a SPSS dataset to SAS by following codes:
%web_drop_table(GSS.ISSP);
FILENAME REFFILE '***.sav';
PROC IMPORT DATAFILE=REFFILE
DBMS=SAV
OUT=GSS.ISSP
replace;
RUN;
PROC CONTENTS DATA=GSS.ISSP;
RUN;
The data in the SPSS file was numeric, but in the SAS output dataset, shows characteristic values. However, in the Proc content results, the variable was labeled as numeric. How do I let SAS showing the numeric values in SPSS not the values in SPSS?
Thank you very much!
@Elaine0223 wrote:
Hi,
I imported a SPSS dataset to SAS by following codes:
%web_drop_table(GSS.ISSP);
FILENAME REFFILE '***.sav';PROC IMPORT DATAFILE=REFFILE
DBMS=SAV
OUT=GSS.ISSP
replace;
RUN;
PROC CONTENTS DATA=GSS.ISSP;
RUN;
The data in the SPSS file was numeric, but in the SAS output dataset, shows characteristic values. However, in the Proc content results, the variable was labeled as numeric. How do I let SAS showing the numeric values in SPSS not the values in SPSS?
Thank you very much!
Since SPSS supports value labels as part of the data SAS creates a SAS format to display those values. Just like any SAS custom format a numeric value would display with the text associated with the format. I suspect if you look in the WORK library you will find a FORMAT catalog and if you examine that catalog will find a number of entries with the names of variables from your set indicating a format created for that variable.
If you want to see the actual numeric value then you can change the format, either permanently with Proc Datasets or creating a new data set from the imported one and changing the format. Or just assign a numeric format for procedure use.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: