Page 1 of 1

Export data to SPSS

Posted: December 16th, 2021, 2:01 pm
by seeisol
Dear CSPro Users,

I am trying to export data to SPSS. Everything works fine until I try exporting floating point numbers. The data is exported fine but I do not know if the problem is the SPSS syntax file (.SPS) or what but I get an error as seen on the attached file. Is there something I am doing wrong? This happens only with floating point numbers

Re: Export data to SPSS

Posted: December 19th, 2021, 1:18 am
by sherrell
Hi Seeiso,

You can export floating pt #s to SPSS. What version of CSPro are you using and how are you exporting the data?

If you can post your dictionary here and provide at least one case with a floating number I can take a look at it.

Sherrell

Re: Export data to SPSS

Posted: December 20th, 2021, 6:13 am
by jodapecol
Good day
In the spss syntax you must put for floating points, example: var (dot, 2)

Re: Export data to SPSS

Posted: December 20th, 2021, 4:28 pm
by seeisol
Hi Sherrell,

I am using version 7.6.0 (released 31 March 2021).

I have attached my dictionary and sample data file.

Thank you in advance.

Re: Export data to SPSS

Posted: December 20th, 2021, 4:33 pm
by seeisol
Hi Jodapecol,

Attached is a screenshot of SPSS syntax generated by CSPro. I never had a problem with it in the past

Regards,

Re: Export data to SPSS

Posted: December 20th, 2021, 5:05 pm
by Gregory Martin
Can you share the export dictionary that is actually causing the problem? Your initial screenshot references F... variables, which aren't in the file you attached.

If the file you previously attached has problems, let us know. I exported the J2... record and read it in via PSPP without issue. I don't have SPSS on my machine, so it's possible that PSPP can read something that SPSS cannot, but I doubt that.

Re: Export data to SPSS

Posted: December 21st, 2021, 5:28 pm
by seeisol
Hi Greg,

You are right my initial screenshot references F... variables which are not in the file I shared. The data file was too big so I had to drop some of the variables leaving the relevant ones, but all the floating point variables are giving me the same challenge hence why I shared these ones. I have attached all the files (including the export specifications). J2 does not have any floating point data entered (maybe that is why it can be imported).

Please try exporting J1 and reading it with PSPP.

Re: Export data to SPSS

Posted: December 21st, 2021, 6:00 pm
by sherrell
Hi Seeiso,

I just ran it without a hitch. I'm also using PSPP.

If interested, why don't you try this out on the beta 7.7? For beginning with that release, we write files natively.

You can download it here: https://www.csprousers.org/beta/

Launch CSPro, go to the "Tools" menu item and choose DataViewer. Open data.csdb

Under the "Files" menu item you'll see export. Choose SPSS. Let us know if you're still having problems.

I didn't notice earlier you're in Maseru. I worked on the 2004 DHS. Lesotho is a beautiful country!

Sherrell

Re: Export data to SPSS

Posted: December 22nd, 2021, 3:46 pm
by seeisol
Hi Sherrell,

Thank you so much. The beta version did the trick.

Yes I am in Maseru. A beautiful country indeed. In 2004 I was still a little boy :lol:

Re: Export data to SPSS

Posted: December 22nd, 2021, 7:27 pm
by sherrell
Hi Seeiso,

Great! Glad to hear the beta version worked. There's a lot of new features in v7.7, not all of which are documented, tho they will be when it gets officially released early next year.

Little boy in 2004: :shock:

I was there twice, and during those (month-long) work trips we went Thaba Basiu, Malealea, and Katse Dam, among other places. Very welcome breaks from the work.

Have a good Christmas & New Year's!
Sherrell