data hsb2; input id female race ses prog read write math science socst; datalines; 70 0 4 1 1 57 52 41 47 57 121 1 4 2 3 68 59 53 63 61 86 0 4 3 1 44 33 54 58 31 141 0 4 3 3 63 44 47 53 56 172 0 4 2 2 47 52 57 53 61 113 1 4 2 2 44 52 51 63 61 50 0 3 2 1 50 59 42 53 61 11 0 1 2 2 34 46 45 39 36 84 0 4 2 1 63 57 54 51 63 48 1 3 2 2 57 55 52 50 51 75 1 4 2 3 60 46 51 53 61 60 1 4 2 2 57 65 51 63 61 95 0 4 3 2 73 60 71 61 71 104 0 4 3 2 54 63 57 55 46 38 0 3 1 2 45 57 50 31 56 115 0 4 1 1 42 49 43 50 56 76 0 4 3 2 47 52 51 50 56 195 0 4 2 1 57 57 60 56 52 ; run; /* First run the code with ODS SELECT and ODS OUTPUT commented out, then run it again with */ /* those two statements active, while ODS TRACE ON and ODS TRACE OFF are commented out */ ODS TRACE ON; proc glm data=hsb2; model read=female race ses prog; /* Two tables are selected by their pathname */ ODS SELECT GLM.ANOVA.read.FitStatistics GLM.ANOVA.read.ModelANOVA; /* One table is saved using its label, the other is saved using its pathname */ ODS OUTPUT 'Fit Statistics'=ReadFit GLM.ANOVA.read.ModelANOVA=ReadANOVA; /* You should verify that ReadFit and ReadANOVA have been saved in the WORK Directory */ run; ods trace off; /* Working with one of the saved tables */ /* Print pvalues for each effect */ title 'Pvalues for Type III F tests'; proc print data=ReadANOVA label noobs; where hypothesistype=3; var source probf; run; title; run; /* An example in which table names are not unique */ *ODS TRACE ON; proc glm data=hsb2; model read write math science socst=female race ses prog; /* Two tables are selected by their pathname */ ODS SELECT GLM.Data.NOBS GLM.ANOVA.socst.OverallANOVA; /* The first table is specified by its path--it's the Overall ANOVA table for Social Studies. */ /* Other tables with the same name are carried along. */ /* The second dataset is specified by a name--it contains the Overall ANOVA tables for */ /* for all response variables, since the Overall ANOVA tables share a common name */ /* The third and fourth tables should be identical, since the name is unique. */ ODS OUTPUT GLM.ANOVA.socst.OverallANOVA=OutSOCSTANOVA OverallANOVA=OutANOVA NOBS=SampleSize GLM.Data.NOBS=SampleSize2; /* You should verify that OUTANOVA, OutSOCSTANOVA, SampleSize, and SampleSize2 have been saved */ /* as data sets in the WORK directory */ run; *ods trace off;