Start a conversation

Export data into SPSS

To export your Castor data into SPSS you will need to follow a few steps, explained in the video below. Watch the video on Castor Academy:

Exporting data into SPSS format | Castor Academy

A short summary of the steps:

  1. Create an export file
  2. When you want to copy this file to SPSS, choose the option: SPSS Export file. 
  3. Click "export". The export file is now saved on your computer in a folder named: studyname_spss_export_datecode. 
  4. It is advisable to move this folder to an easily accessible but secure file location.
  5. The file you have exported is a zip-file (a compressed file) containing several .dat and .sps files. Before you can import these files into SPSS you have to unzip all the files (using "unzip" or "extract"). 
  6. During the unzip process you will be asked to specify a location to save the files. This location is used later to import the files in SPSS, so make sure that they are easy to find.

From this folder containing the unzipped files you start importing the data to SPSS.

  1. Open the syntax file (the .sps file) in SPSS. The syntax file of the study data has the format: Studyname_syntax.sps. The reports/surveys have the format: Studyname_reportname_syntax.sps and Studyname_surveyname_syntax.sps
  2. In the syntax file the data path of your just saved data should be visible. This has to be visible in the fourth row in the following format:  /FILE='Your_study_name.dat'
  3. This is how it looks when you have opened the file in SPSS:
  4. Make sure your file path is correct. Open the folder in which the .dat file is stored. In Windows, right click on the file and click 'Properties'. The file path is listed next to 'Location'. In Mac, select the file, then press Command + i. The file path is listed next to 'Where'.
  5. If you are using SPSS version 21 or higher you should remove the following line:  /QUALIFIER=’”’.
  6. Select the whole file with ctrl+a and run this using the play button in SPSS. The file is now being imported in SPSS (this may take a while).
  7. If for some reason the above steps dont work it is adviseable to check the data path of the .dat file. This is the most common cause for errors.

Export in a wide format and merging data files

Report and survey data are exported in a long format, meaning that every instance is shown on a new row. See here how you can restructure your report and survey data into a wide format and how you can merge your study data with your report or survey data.

Export to SPSS when using a Mac computer

When exporting Castor data to SPSS on a Mac its a bit trickier to put the directory of your data in the .sps file.

After you extracted your export file (the ZIP file) you get a directory containing at least 1 set of .dat and .sps files (data + syntax). You then have to rightclick 1 of them and select "get info". You will see this popup:

After this rightclick the last part after "Where:" (the part that ends with _20151102035054 in the image), you can copy the directory name. You can now paste this in the syntax in the location where the data path has to be. In this case that would be:





The bold part is the part pasted in. If you then run the syntax using the play button the data should be imported.

Troubleshooting SPSS

My calculation fields are empty

If the value of your calculation fields is a text (string), then change the syntax of your .sps file, so that SPSS knows that the calculation field is a text.

For example, you will see:

calculationfieldname F10.0

Change this into:

calculationfieldname A15

My numbers with decimals are not shown properly

If you use numbers with decimals, then the default decimal separator in Castor is a period (.), while it can be a comma in your SPSS. To change this, add the following line in the third line of the syntax in your .sps file:


I get the error message "File not found". 

SPSS cannot find the data file. There are several explanations:

  • The file is still zipped. Make sure that the file is unzipped/extracted.
  • The file path is incorrect. Please check the file path in the syntax.
  • The file is in a place that SPSS cannot find, e.g. a digital/remote workspace or cloud. Make sure this is not the case. For example, try saving the data file on Desktop or in the same folder as your SPSS and change the file path in the syntax accordingly.
  • For Mac users: The file is in a place that SPSS cannot find, e.g. Documents, Downloads, Desktop, or connected external disks. See also this SPSS article. Make sure this is not the case. For example, try saving the data file on in the same folder as your SPSS and change the file path in the syntax accordingly.

My data does not match up with my variable names. 

It is possible that your phase/step/report/survey (package) name includes a semicolon (;). Since the delimiter is a semicolon, SPSS will see the name as two values, causing your data to shift one column. You can solve this by deleting the semicolon from your phase/step/report/survey(package) name in Castor and replace it with a different character.

I get the error message "Duplicate variable name (only first 64 characters are counted)". 

SPSS only allows variable names up to 64 characters. This error message indicates that your variable names are too long and that SPSS views them as duplicates. 

For example, your variable names in Castor could be:

  • what_is_your_one_and_only_favorite_thing_or_hobby_to_do_in_the_summer#badminton
  • what_is_your_one_and_only_favorite_thing_or_hobby_to_do_in_the_summer#tennis

In SPSS, the variables will be the same, which is not allowed:

  • what_is_your_one_and_only_favorite_thing_or_hobby_to_do_in_the_s

You can fix this by shortening the variable name in Castor. If this is not possible, you will need to manually replace the variable names in the syntax at '/VARIABLES', 'VARIABLE LABELS', and 'MISSING LABELS':

Choose files or drag and drop files
Was this article helpful?
  1. Castor Support Team

  2. Posted
  3. Updated