Thank you @Reeza for sharing your approach. I want to use your method to read an SPSS dataset into SAS and bring with it the value and variable labels (It looks like when I export from SPSS to SAS, I can only bring the value labels and not the variable labels).
1- May you please edit my code to include the value and variable labels?
2- Also, how may I restrict my SAS data to a subsample. for example, WHERE agegroup = 2;
PROC IMPORT
DATAFILE= "C:\SPSSdata.sav"
OUT=SASdata
DBMS=sav REPLACE;
RUN;
Thanks
@Emma_at_SAS unfortunately I no longer have SPSS to test anything out.
For filtering that's fairly easy.
You've named your output data SASdata and can use a WHERE statement to filter it. See two examples below, one to create a new data set and one to filter a data set in a procedure.
data sasData_Group2;
set SASdata;
where agegroup=2;
run;
proc means data=sasdata;
where agegroup=2;
run;
Thank you @Reeza for your response. I was wondering how to use a WHERE statement in the PROC IMPORT to only import part of a dataset. Maybe that will reduce the time to read a subsample from a larger dataset. Thanks
Thank you for your suggestion @Reeza
I will try it. the WHERE statement does not turn blue and my SPSS data is password protected. I cannot check this code now but will check it later. Thanks
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 the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.