Raynald's SPSS Tools

The collection of syntaxes, macros, scripts and hints for better solutions of data management and data analysis problems in IBM SPSS Statistics

SPSS Syntax

SPSS Syntax iconGood command of SPSS. You'll find hundreds of syntax solutions on this site, grouped by purpose: read and export data, file restructuring, confidence intervals, transform variables, ROC-analysis…

Sample Syntax Library is the origin of Raynald's SPSS Tools, and remains the biggest section of the site, some 80% of the contents. If you are looking for a solutions of a certain data transformation or data analysis problem, dive right into. I also encourage you to use Google search form above, as the number of code samples is quite large.

If you prefer to go step-by-step through all web-site content, consider to start with SPSS Syntax Home. You'll find there some explanations why syntax is so important in SPSS Statistics, even in presence of well-developed GUI. There are also number of links to other site's sections, directly related to syntax, like learning and debugging syntax, and SPSS Programming and Data Management book page.


Matrix, like Macro, is another language, implanted into SPSS syntax long time ago. As one could easily guess, it aimes to provide matrix-wise operations, instead of row-by-row calculations with data. There is no separate section on this site on matrix yet (just an idea), but you can find numerous solutions with Matrix in Sample Syntax Library. Or just type "END MATRIX" in the search box above to find examples.

SPSS Macros

SPSS Syntax Macro iconWrapping syntax with SPSS Macro functionality. See how to make syntax smarter yet smaller.

Using macros in SPSS syntax is very natural. Most macros are located in Sample Syntax Library on this site. Sample Macro Library tends to unify useful macro utilities, less related with a specific data analysis task, applicable in many different situations. Visit SPSS Macro Home for better view of macro stuff on the site. For those who learning macros, macro tutorial and debugging pages will be of help.

The independent site section, Kirill's SPSS Macros Page, is a truly gem — the extensive collection of well-done and well-documented macros developed by Kirill Orlov.

Python Scripts

Python iconCross-platform power and fun language closely integrated with SPSS starting version 14. It will replace macros and Basic scripts for you, and will do much more if you invest some time to master it.

Development with Python is so fast and straightforward that much of SPSS extension commands implemented by current SPSS vednor (IBM) are done with Python (and sometimes R) use.

Check out Sample Python Library to find samples of useful Python code for SPSS users.

R Scripts

R iconAnother fruitful integration making SPSS workbench capabilities almost limitless. Use open-sourced cutting-edge statistical algorithms from within SPSS Statistics. Sample R Library is almost empty yet — waiting for your inputs!

Basic Scripts

Good old Sax (Win Wrap) Basic, embedded into SPSS for Windows to control user interface and output.

Dozens of scripts are at your disposal at Sample Scripts Library page. With the advent of Python and other ingegration plugins Basic scripts are less demanded. As most of them were written and tested on versions prior to 16, read first important compatibility comments in Help system of your current version.

SPSS Resources

This site is not all code! I have merged a few separate pages into kind of SPSS Tools Blog, with tips, FAQs and notes for SPSS users. There is important Tutorials page, joining internal didactic materials and external links to significant learning content, related to SPSS. Also, in spite of existence of powerful Web-search engines, I am proud to possess one of the biggest SPSS links collection in the Internet. Many personalities I refer there are kind contributors of SPSS Tools.