The DO IF command is part of the SPSS syntax language, and it is a structure in that it must be accompanied by an END IF command further down in the syntax file. The help system provides an overview of this command along with examples as shown in the following screenshot. This feature provides a level of program control that can be very useful when dealing with situations that require more complex transformation logic:
In the customer satisfaction data, for example, each store may have its own unique characteristics in terms of customer demographics and competitive environment. Store managers may want to calculate satisfaction levels and product categories in a manner that reflects these factors.
The following DO IF example uses STORE to determine how departments should be grouped into core and convenience groups. Mean satisfaction is also calculated...