SYNTAX is what SPSS calls code for conducting statistical analysis.
To open a new SYNTAX file, click on "File" --> "New" --> "Syntax", in the upper left corner of the window, and this will open a blank ‘.sps’ file to begin writing SYNTAX.
To save SYNTAX, click on the floppy disk icon highlighted in the red circle.
To search for commands in SPSS, begin by typing out the first letters and a sub-menu will automatically appear for suggestions of various commands.
We can think of a SYNTAX file as a ‘live’ word document, where we write commands that are actions for SPSS on our data from descriptive statistics to regression models.
SPSS SYNTAX is written with commands which are the main function or analysis you want SPSS to do in a SYNTAX block.
Depending on what your kind of analysis you are doing it may require subcommands, which are found on a new line under the command and start with a “/”. Subcommands are used to indicate specific statistics or options to include in the output.
By starting a line with a “ * “, we can write notes and comments that will appear gray. SPSS does not recognize this as SYNTAX.