BookmarkSubscribeRSS Feed
Elaine0223
Calcite | Level 5

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! 

 

 

2 REPLIES 2
ballardw
Super User

@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.

Elaine0223
Calcite | Level 5
Thank you!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 907 views
  • 1 like
  • 2 in conversation