This is an example, using one of the datasets we ship with the product.
dataset close all.
get file '/Applications/IBM SPSS Statistics/Resources/Samples/English/Employee data.sav'.
dataset declare d.
oms /select all /destination viewer=no /tag="_n_".
oms /select tables /if subtypes='Classification Results' /destination format=sav outfile=d /tag="x".
DISCRIMINANT
/GROUPS=jobcat(1 3) /VARIABLES=salary salbegin jobtime prevexp /STATISTICS=TABLE.
omsend tag="x".
dataset activate d.
select if Var2 = "Count".
execute.
delete variables command_ to var3 total.
omsend tag="_n_".
BEGIN PROGRAM.
import spss
dataCursor=spss.Cursor()
data=dataCursor.fetchall()
dataCursor.close()
d=list(data)
N=0
success=0
c=0
r=0
for row in d:
c=0
for cell_data in row:
N=N+cell_data
if r == c:
success=success+cell_data
c=c+1
r=r+1
pct=success/N
results=[N,success,pct]
spss.StartProcedure("Results", "RESULTS")
tbl = spss.BasePivotTable("Classification Results", "CR", caption="DISCRIM model")
tbl.SimplePivotTable(rowdim="Case",
rowlabels=['1'],
coldim="",
collabels=['N',"N(Success)","Pct(Success)"],
cells = results )
spss.EndProcedure()
END PROGRAM.
------------------------------
Rick Marcantonio
Quality Assurance
IBM
------------------------------