DATA Step, Macro, Functions and more

Errors inputting variables from an SPSS file to SAS University

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

Errors inputting variables from an SPSS file to SAS University

Hello,

 

I've been analyzing survey data in SPSS and want to import it into SAS so that I can begin to learn how to conduct similar analyses in SAS. There are up to 59 observations per variable. However, when I try to input variables from the .sav file into a SAS dataset, it gives me 1086 rows, most of which are missing. In addition, it reports values for several hundred observations which never occurred. Like I said, there should only be 59 observations, at most, per variable.

 

Here's the code I am using (with slight redactions for security):

 

data proceval;

infile '/folders/myfolders/sasuser.v94/XXXX process Evaluation Survey 9.2.17.sav';

input [VariableName] [VariableName];

run;

 

 

What could be causing this???

 

Thanks so much!


Accepted Solutions
Solution
‎09-10-2017 06:05 PM
Super User
Posts: 23,928

Re: Errors inputting variables from an SPSS file to SAS University

Posted in reply to gjenkins3

You don't use a data step to import an SPSS file, you use PROC IMPORT.

You should move your files out of the SASUSER folder and create a custom folder under myfolders that you can use, IMO. 

 

proc import out=procEval datafile='/folders/myfolders/xxx 9.2.17.sav' DBMS=SPSS replace; run;

View solution in original post


All Replies
Solution
‎09-10-2017 06:05 PM
Super User
Posts: 23,928

Re: Errors inputting variables from an SPSS file to SAS University

Posted in reply to gjenkins3

You don't use a data step to import an SPSS file, you use PROC IMPORT.

You should move your files out of the SASUSER folder and create a custom folder under myfolders that you can use, IMO. 

 

proc import out=procEval datafile='/folders/myfolders/xxx 9.2.17.sav' DBMS=SPSS replace; run;
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 132 views
  • 1 like
  • 2 in conversation