An often requested feature is to export variable and value labels to Excel. This handy tool creates an SPSS Dataset containing these labels. It can either be be saved as an Excel sheet or further edited in SPSS.
SPSS Create Dictionary Dataset Tool - How To Use
- Make sure you have the SPSS Python Essentials installed.
- Next, download and install the Dictionary Dataset Tool. Note that this is an SPSS custom dialog.
- Click .
- Click syntax. and run the pasted
- This creates a new dataset called Dictionary_Overview holding all value labels and variable labels.
- Note that the value for all variable labels is (the lowest value found in the dictionary -1). It merely serves as a placeholder for the value label "Variable Label" and should not be taken literally.
- To avoid confusion, display value labels rather than values by clicking the value labels icon (see screenshot below).
- Clicking the tool's button will take you to this tutorial. We very much appreciate your feedback on it.
Saving the dictionary overview as Excel sheet
Creating a single sheet Excel workbook holding the dictionary information is demonstrated below. Note that it saves value labels rather than values. For more on setting your working directory see Change Your Working Directory.
cd 'd:/temp'.
*Save as Excel sheet.
save translate outfile 'dictionary_overview.xls'
/type xls
/version 8
/fieldnames
/cells = labels.
Final Note
We've had some doubts regarding the optimal output format before we finally went with a single dataset holding all value and variable labels. An alternative we considered was to directly create an Excel workbook with separate sheets for value labels and variable labels. We may offer this as a second version at some point.
THIS TUTORIAL HAS 13 COMMENTS:
By Tolga on July 25th, 2014
Hey!
Great site - great tools! Love what you are doing.
This tool creates dictionary file as in alphabetical order not the study order. Would be nice if it was possible.
By Tom on January 20th, 2015
I like this tool, but it doesn't quite get me where I need to go. In your description it mentions including the variable labels but it appears to only include the variable names. I was also looking to put all the variable and value information on one row, where all the values and their labels would be in a single cell for each variable.
By Ruben Geert van den Berg on January 21st, 2015
The variable labels of the original dataset are included as value labels in the dictionary dataset. Make sure you switch on value labels in the dictionary dataset like we described.
I don't see the point of putting everything in a single cell.
We did consider separate datasets (or sheets in an Excel workbook) for value labels and variable labels. If many visitors request this feature, then we'll build it. However, we're currently very busy writing an SPSS beginners tutorial.
By fiona on March 16th, 2016
Hi, I keep getting the following message, can you help? I using spss 22. Thanks
restore.
>Warning # 234
>A RESTORE command occurred with no corresponding PRESERVE. This RESTORE has
>been ignored.
By Ruben Geert van den Berg on March 17th, 2016
Hi Fiona,
It's a completely harmless warning (if you're curious, you may want to look up PRESERVE and RESTORE in the CSR). This tool is somewhat outdated and I'll probably rewrite it at some point but I'm not entirely sure about a new format for it.