PRESORTED Subcommand (AGGREGATE command)

If the data are already sorted into the desired groups, you can reduce run time and memory requirements by using the PRESORTED subcommand.

  • If specified, PRESORTED must precede BREAK. The only specification is the keyword PRESORTED. PRESORTED has no additional specifications.
  • When PRESORTED is specified, the program forms an aggregate case out of each group of adjacent cases with the same values for the break variables. Unless the cases are sorted by the break variables, the results will be quite different from what would be produced if PRESORTED were not specified.
  • When PRESORTED is specified, if AGGREGATE is appending new variables to the active dataset rather than writing a new file or replacing the active dataset, the cases must be sorted in ascending order by the BREAK variables.

Example

AGGREGATE OUTFILE=’/temp/temp.sav’
 /PRESORTED
 /BREAK=gender marital
 /mean_age=MEAN(age).