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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.