Some Rules About Running Macros in SPSS.
(1) Download and run the macro definition command set EXACTLY AS IS from the web page. Do not modify the code in any way. Many users mistakenly change the DEFINE command, customizing it to their own data or variables. This will produce an error. TO REPEAT: DO NOT MODIFY THE MACRO IN ANY WAY.
(2) All my macros produce an SPSS command defined by the macro name. It is through this command that you get the macro to work. The syntax structure for the macro can be found on the web page accompanying it or, in some cases, in the published article that describes the macro’s functionality. For lessons on how to run SPSS commands through the syntax system, consult the SPSS help files or an SPSS manual.
(3) You do not need to run the macro command definition set more than once. Although there is no harm in doing so, the second time you do, you will get a WARNING message from SPSS saying something like
Warning # 6804 in column 3.
The macro name specified on the DEFINE command duplicates the
name of a previously defined macro. This instance will take precedence.
This is a harmless warning and need not concern you. Many users believe they have done something wrong when this warning appears.
(4) Make sure you run the ENTIRE macro command set on the web page. Many users mistakenly leave off the last line and then try to rerun the command set when nothing happens. This will produce an error that looks something like
Error # 6805 in column 1. Text: DEFINE
There is an instance
of a DEFINE command nested within another DEFINE.
Nested DEFINE's are not permitted. All text up to the matching !ENDDEFINE .
There is no way out of this. You’ll have to quit SPSS and start again.
(5) If nothing happens when you run the macro command set on the web page, THAT IS OK. The macro will do nothing until you then execute the macro command by feeding it the parameters pertinent to your analysis and data set. The web page describes the acceptable syntax to make the macro do what it can do.
Many errors become infinite loops and are nearly impossible to escape. Quitting SPSS and starting fresh is usually the only option available in such cases.
(6) My macros were written on SPSS for Windows. Although many of them will work on the Macintosh platform, macros that require file reading and writing will not because of differences between Macs and PCs in the way file paths are represented in the code. All of my macros write and save to the “C:” root directory. But there is no “C:” drive on the Macintosh, so the Mac will produce file read and write errors when it encounters this part of the code. One day, I will upload Macintosh-compatible versions of my macros. To make the versions posted here Mac compatible, you have to change the file paths in GET and SAVE commands in the macro definition command set to be consistent with Mac path conventions.
(7) For some reason, these macros don’t work with the INCLUDE command. If you are getting errors and are using the INCLUDE command to execute the macro definition commands from a file, try running the macro definition program manually, without the INCLUDE command.