Help using Base SAS procedures

Limit to # of variables PROC IMPORT can pull from SPSS files?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 9
Accepted Solution

Limit to # of variables PROC IMPORT can pull from SPSS files?

Howdy.

I currently import SPSS data using LIBNAME statements with POR files. This has been a perfectly usable method for my work as it pulls in all of the data for all of the records/observations, the variable names and labels, and the values. Example:

LIBNAME data1 SPSS "C:\data\example.por";

DATA impdatatest;

     SET data1._FIRST_;

RUN;

However, I'd like to import the value labels as well without going through a long PROC FORMAT / PROC DATASETS method. PROC IMPORT can import SAV files pulling in the data for all of the records/observations, variable names and labels, and value names and labels, but I can't get the procedure to register all of the variables from the SPSS file. My example SAV file includes 402 variables, but only the first 146 are being imported.

PROC IMPORT DATAFILE="C:\data\example.sav"

     OUT=impdatatest

     DBMS=SAV

     REPLACE;

RUN;

Are there limits to the number of variables that PROC IMPORT can import from SPSS files or does anyone know of a workaround to this issue?

Thank you in advance for your help.

Regards,

Drew


Accepted Solutions
Solution
‎05-14-2012 04:11 PM
Occasional Contributor
Posts: 9

Re: Limit to # of variables PROC IMPORT can pull from SPSS files?

Tech Support did indeed help solve this issue for me.

For anyone else looking for a solution to this problem, I needed to upgrade from SAS 9.1.3 Service Pack 3 to SAS 9.2 or SAS 9.3 to get all of the variables and labels to import from the SPSS file. Short of that, since someone else at my company is in charge of upgrading our SAS version, I was able to download Service Pack 4 for SAS 9.1.3

http://ftp.sas.com/techsup/download/hotfix/e9_sbcs_prod_list.html#h0

followed by a hot fix to the SAS/ACCESS issue:

http://ftp.sas.com/techsup/download/hotfix/e9_win_sbcs.html#pf

Thanks again for your help, Reeza and, in SAS Tech Support, Peter Ruzsa.

View solution in original post


All Replies
Super User
Posts: 19,770

Re: Limit to # of variables PROC IMPORT can pull from SPSS files?

Try DBMS=SPSS rather than SAV?

Occasional Contributor
Posts: 9

Re: Limit to # of variables PROC IMPORT can pull from SPSS files?

It's a funny thing, some of the official SAS documentation online specifies using DBMS=SPSS but others specify using DBMS=SAV. I get an error when I specify DBMS=SPSS over DBMS=SAV:

ERROR: DBMS type SPSS not valid for import.

Super User
Posts: 19,770

Re: Limit to # of variables PROC IMPORT can pull from SPSS files?

That's a bug

http://support.sas.com/kb/37/249.html

No idea on your original problem then, contact tech support is probably my guess. The biggest SPSS file I have has 137 col, so less than your problem.

Occasional Contributor
Posts: 9

Re: Limit to # of variables PROC IMPORT can pull from SPSS files?

Okay, thanks, Reeza.

I will contact SAS tech support; I was just throwing this out to the community first since I couldn't find anything online about limits.

Solution
‎05-14-2012 04:11 PM
Occasional Contributor
Posts: 9

Re: Limit to # of variables PROC IMPORT can pull from SPSS files?

Tech Support did indeed help solve this issue for me.

For anyone else looking for a solution to this problem, I needed to upgrade from SAS 9.1.3 Service Pack 3 to SAS 9.2 or SAS 9.3 to get all of the variables and labels to import from the SPSS file. Short of that, since someone else at my company is in charge of upgrading our SAS version, I was able to download Service Pack 4 for SAS 9.1.3

http://ftp.sas.com/techsup/download/hotfix/e9_sbcs_prod_list.html#h0

followed by a hot fix to the SAS/ACCESS issue:

http://ftp.sas.com/techsup/download/hotfix/e9_win_sbcs.html#pf

Thanks again for your help, Reeza and, in SAS Tech Support, Peter Ruzsa.

🔒 This topic is solved and locked.

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

Discussion stats
  • 5 replies
  • 863 views
  • 3 likes
  • 2 in conversation