Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

(I'm asking this question for a friend, honest...)

Is there an easy way to convert from an SPSS file to a SAS file, which preserves the formats AND labels? Saving as a POR file gets me the labels (I think) but not the POR file. I tried to save to a SAS7dat file but it didn't work. Thanks,

share|improve this question
Invite your friend here! – mbq Jan 7 '11 at 11:02
I totally want to, but she's too busy writing academic articles. In general, I wonder how many non-R statisticians we've got on the site. – Tal Galili Jan 7 '11 at 11:48
2  
I think you should change the title to reflect the concern with keeping the formats and labels. Actually saving the file in the other softwares format is trivial, keeping the labels and value labels is the hard part. – Andy W Jan 7 '11 at 20:20
Hi @TalGalili I mostly use SAS but also R – Peter Flom Mar 6 at 1:18

2 Answers

up vote 2 down vote accepted

I would just suggest they make the syntax to relabel and reformat the variables. You can use the command, display dictionary. in PASW (aka SPSS) to output the dictionary in a table that you can copy and paste the variable names and labels. Looking at this example of making SAS labels it should be as simple as pasting the text in the appropriate place.

Formats may be slightly harder, but I could likely give a suggestion if pointed to a code sample of formats in SAS (if copy and paste from the display dictionary command won't suffice for value labels or data formats).

share|improve this answer
Looking at this document, support.sas.com/publishing/pubcat/chaps/59498.pdf, their also appears to be differences in definitions between SAS and SPSS that could cause confusion. Formats in SPSS appear to be referred to as informats in SAS. Value labels in SPSS appear to be referred to as formats in SAS. – Andy W Jan 6 '11 at 19:10
Thank you for the suggestion Andy. I forwarded it to my friend - and I hope she will find it useful. – Tal Galili Jan 6 '11 at 21:53

SPSS writes SAS7dat format files normally with no problems. When you it did not work, what actually happened?

share|improve this answer
I took the problem to not be actually writing a usable file, but to transporting the value labels to SAS. I don't have a copy of SAS handy to see if the export to SAS7dat files normally saves this or not. – Andy W Jan 7 '11 at 17:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.