Learning SAS? Welcome to the exclusive online community for all SAS learners.

Trouble importing spss file in SAS studio

Reply
New Contributor
Posts: 2

Trouble importing spss file in SAS studio

I am getting an error message when using 'proc import datafile' with an spss file.  Here is my code:

proc import datafile="/folders/myfolders/English.sav" out=Englishdata dbms=spss replace;

run;

What am I missing?

Super Contributor
Posts: 490

Re: Trouble importing spss file in SAS studio

What is the error message

Provide the log part

New Contributor
Posts: 2

Re: Trouble importing spss file in SAS studio

The error message is:

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

42 ;

NOTE: PROCEDURE IMPORT used (Total process time):

  real time 0.00 seconds

  cpu time 0.01 seconds

  

NOTE: The SAS System stopped processing this step because of errors.

43 Proc import datafile=”/folders/myfolders/English.sav”

  _

  22

  76

ERROR 22-322: Syntax error, expecting one of the following: ;, DATAFILE, DATATABLE, DBMS, DEBUG, FILE, OUT, REPLACE, TABLE,

  _DEBUG_. 

ERROR 76-322: Syntax error, statement will be ignored.

44 out=EnglishData dbms=SPSS REPLACE;

45 run;

46 

47 ;

48 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

58 ;

I am using a Mac.  I also tried code with the exact path directory and am still getting the same error message:

Proc import datafile=”/Users/ga2/Desktop/SASUniversityEdition/myfolders/English.sav”

out=EnglishData dbms=SPSS REPLACE;

run;


Error LOG:

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

42 ;

NOTE: PROCEDURE IMPORT used (Total process time):

  real time 0.00 seconds

  cpu time 0.01 seconds

  

NOTE: The SAS System stopped processing this step because of errors.

43 Proc import datafile=”/Users/ga2/Desktop/SASUniversityEdition/myfolders/English.sav”

  _

  22

  76

ERROR 22-322: Syntax error, expecting one of the following: ;, DATAFILE, DATATABLE, DBMS, DEBUG, FILE, OUT, REPLACE, TABLE,

  _DEBUG_. 

ERROR 76-322: Syntax error, statement will be ignored.

44 out=EnglishData dbms=SPSS REPLACE;

45 run;

46 

47 ;

48 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

58 ;

Any help would be helpful.

Thanks!

Super Contributor
Posts: 490

Re: Trouble importing spss file in SAS studio

Do you still have this problem.

Does this file open on other OS.

Can you open other SPSS file? on your machine

Super User
Posts: 6,932

Re: Trouble importing spss file in SAS studio

You use the wrong double quotes (hex 94 instead of hex 3D)! Replace them with ".

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 4 replies
  • 494 views
  • 0 likes
  • 3 in conversation