03-26-2015 11:32 AM
I am trying to import an SPSS file into SAS using Proc Import with DBMS=SPSS replace. The SPSS file has 394 variables. However, when I try to import it, the SAS file reads 8,458 variables, most of which are empty columns. Here's what it looks like in Viewtable.
The variable with the name "Subunit" is H_1 in my SPSS dataset, so the subsequent "Subunits" are imported as H_1A, H_1B, etc. How can I import this file and still preserve the formatting from SPSS.
This SPSS file was created using Class Climate from Pearson, if that matters.
03-26-2015 11:42 AM
Which OS are you running? Which OS created the file? I'm not sure that different OS versions of SPSS would be exactly the same any you may be crosswise with this.
Also post the code you used to import so we could see if any options we'd suggest were already used.
SPSS does provide a format for cross-platform interchange. It may be that's what you need.
Also check your documentation as to which version of SPSS files you can read with SAS and which version created the file. A newer version of SPSS may be needed to save "backwards' to an older version SAS can read.
03-26-2015 12:16 PM
I'm running Windows 7 Enterprise (64-bit). Not sure about the computer that created the file. It was automatically generated from an online survey system, downloaded by a colleague, then sent to me. I'll ask about how those files are generated. I'm running SPSS 22, but I'm not having any problems uploading any SPSS files I have created myself.
I didn't do anything fancy with the code, just the basics:
PROC IMPORT OUT= work.Mensswd_14
DATAFILE= "G:\IMIRDATA\AllSurveys\Athletic Department surveys\End of season reports\2014-Winter-Spring-RawData\Basketball and Swimming and Diving\Mens-Swimming and Diving-Winter-2013-RawData.sav"
03-26-2015 02:56 PM
Take a close look at text fields in SPSS, especially if one of them was and open entry. It may be that there is some encoding issue or something getting interpreted oddly. I don't know if odd characters in a variable label might cause issues. Or maybe in inclusion of an image??
Or export the data from SPSS to CSV, I know you'll loose some info but it may let you find if there is a problematic field.
03-26-2015 03:03 PM
Thanks. I exported to a .csv and it looks like it will be OK. I wanted to keep the coding though, so I just imported the file and dropped the extra variables.
Thanks so much, you've been a huge help!
03-26-2015 03:23 PM
It has been a long time since I worked with SPSS but I know that the last version had an export to SAS feature that allowed it to create SAS Proc Format code to generate value labels and I think the variable labels came across as well with the limits on SAS labels. If the data had the entire question, and possibly response choices, as the variable label then the length likely exceeds SAS label limits but would be a start.