Here is a short presentation on how to program SPSS using its command language. Please see the related SPSS documentation in the Manuals section from the home page. Click here to see the presentation: Programming SPSS.