* ======================================================================= * File: restructure.SPS . * Date: 28-May-2003 . * Author: Bruce Weaver, weaverb@mcmaster.ca . * Notes: Simple demonstration of CASESTOVARS and VARSTOCASES . * ======================================================================= . * Read in file with multiple rows per ID number . DATA LIST LIST /idnum score(2f2.0). BEGIN DATA. 5 14 7 21 7 25 11 8 11 10 11 14 16 2 18 4 18 10 END DATA. * Restructure to one row per ID number . CASESTOVARS /ID = idnum /SEP="". list all. * Now revert to original format . VARSTOCASES /MAKE score FROM score1 score2 score3 /INDEX = index(3) /KEEP = idnum /NULL = drop. list all. * ======================================================================= .