*SPSS syntax example for moving all string variables to end of file.
*Note that this syntax requires the SPSS Python Essentials in order to run.

begin program.
import spss
strVars,numVars = '','' # Define empty Python strings
for ind in range(spss.GetVariableCount()): # Loop over all variables
    if spss.GetVariableType(ind) == 0: # Variable type == 0 indicates numeric variable
        numVars += spss.GetVariableName(ind) + '\n' # Add numeric variable to Python string
    else:
        strVars += spss.GetVariableName(ind) + '\n' # Add string variable to Python string
spss.Submit('''
add files file */keep %s %s. # ADD FILES command for reordering variables
execute.
'''%(numVars,strVars)) # Replace "%s %s" by Python string holding numeric and string variable names
end program.