By now, you should know how important it is to save your syntax in SPSS. Well, despite your best efforts, sometimes accidents happen. The last couple of summers, I did data management for a longitudinal study of college students’ sexual behaviors. Once, after I hit a flow state and didn’t look up from my computer for hours, my stomach’s aggressive growling jerked me back to reality. Adhering to my policy never to work when hungry, I decided to close my SPSS file and have some lunch. But when SPSS prompted me to save my syntax, my hypoglycemic brain directed my fingers to click “don’t save.” I noticed what I was doing a split second before I clicked the wrong button, but it was already too late! My last four hours of work were gone. Or were they? (They weren’t.)
Here is what I did to recover my syntax:
Step 1. Don’t Panic.
Step 2. Eat lunch. Nothing helps me keep my cool like having some PB&J in my belly.
Step 3. Calmly Google how to recover SPSS syntax.
My Google wizardry taught me that, fortunately, the syntax window is not the only place SPSS stores your syntax. The SPSS journal logs your activity on SPSS and stores it in one file. That means every time you open or close a window or perform a command, it goes in the journal. You can change the journal settings to record only your recent activity, but the default is to record everything you ever do in one giant file.
To access the journal file, go to Edit --> Options…, and select the File Locations tab. This window will show you the location of the journal file. To open the journal file, you have two options. First, you can open it in SPSS by opening the journal file as if it were a syntax file. Second, you can open the journal file as a text file. After closing SPSS, navigate to the location listed for the journal file, and open it with a text editor like Notepad.
This video gives a good demonstration of how to use a journal file, beginning around 3:00.
It’s that easy to find lost syntax. However, just because the journal file exists doesn’t mean you shouldn’t be meticulous about saving your work in syntax files. What if you find that your journal was mysteriously set to “overwrite” instead of “append”? Syntax files also offer features that the journal doesn’t, like the ability to store commands in multiple files. But if you forget to eat lunch and make a mistake because you are working while hungry, the journal is a very handy backup. Just remember to take food breaks next time.