If I understand the question correctly, there is no need to use a loop construct. SPSS commands with the VARIABLES subcommand, such as FREQUENCIES, allow you to specify several variables.
The basic syntax for FREQUENCIES:
FREQUENCIES VARIABLES= varlist [varlist...]
where [varlist] is one variable name, several variable names with spaces delimited, a range of consecutive variables specified with the TO keyword, the ALL keyword, or a combination of the previous parameters.
For instance:
FREQUENCIES VARIABLES=VARA FREQUENCIES VARIABLES=VARA VARB VARC FREQUENCIES VARIABLES=VARA TO VARC FREQ VAR=ALL FREQ VAR=VARA TO VARC VARM VARX TO VARZ
See SPSS Statistics 17.0. The syntax for the commands is available at http://support.spss.com/ProductsExt/SPSS/Documentation/SPSSforWindows/index.htm
Please note that many years have passed since I used SPSS.
source share