%let Rprtng = H:\RCP\RCP_Data\FaheTJ\Miscellaneous\SHRUG\GMMs\20081024\Reporting ; libname CHSrvLib "&Rprtng\SAS Data" ; options FmtSearch = ( CHSrvLib ) ; ods pdf file = "&Rprtng\Output\PROC REPORT Examples.pdf" ; proc format ; value AgeFmt 18 -< 35 = '18-34' 35 -< 65 = '35-64' 65 - high = '65+ ' ; value BMIFmt . = " " 0 -< 18.5 = "Underweight" 18.5 -< 25 = "Normal" 25 -< 30 = "Overweight" 30 -< 35 = "Class I Obese" 35 -< 40 = "Class II Obese" 40 - high = "Class III Obese" ; value CholFmt . = " " 0 -< 5.2 = "Low Risk" 5.2 -< 6.2 = "Moderate Risk" 6.2 - high = "High Risk" ; value SexFmt . = " " 1 = "Male" 2 = "Female" ; /* for use in displaying percentages with two decimals and without the % sign */ picture Per2Fmt /* rate per 100 */ ( round ) . = ' 0.00' ( noedit ) low -< 100 = '009.99' ( mult = 10000 ) other = '100.00' ( noedit ) ; run; *Hypertension risk by region - showing column percent; proc report data = CHSrvLib.PanHS95 nowd ; weight pwgtq ; column Hyper Region, PctN ; define Hyper / group order = data ; define Region / across order = data ; define PctN / '%' format = Per2Fmt. ; run; *Body mass index distribution by sex and age group - showing row percent; *Except I had to make it column percent to get it to work; proc report data = CHSrvLib.PanHS95 nowd ; weight pwgtq ; format Age AgeFmt. Sex SexFmt. BMI BMIFmt. ; column BMI Sex, Age, PctN ; define Sex / across ; define Age / across ; define BMI / group order = data ; define PctN / '%' format = Per2Fmt. ; run; *Blood Lipids Statistics by Region; proc report data = CHSrvLib.PanHS95 split = '|' /* default is / which is used in labels */ nowd ; weight pwgtq ; column Region ( Chol LDL HDL Trig ), ( Min Max Mean Median ) ; define Region / group ; run; *Cardiovascular risk factors by region and age group (with subtotals); proc report data = CHSrvLib.PanHS95 nowd ; weight pwgtq ; column Region Age Chol Total_N Cum_N_By_Region_Age Cum_N_By_Region Region_Age_PC Region_PC ; format Age AgeFmt. Chol CholFmt. ; define Region / group order = data ; define Age / group ; define Chol / group ; compute before ; Total_N = N ; Cum_N_By_Region_Age = 0 ; Cum_N_By_Region = 0 ; endcomp ; compute Cum_N_By_Region_Age ; Cum_N_By_Region_Age = sum ( Cum_N_By_Region_Age, N ) ; endcomp ; compute Cum_N_By_Region ; Cum_N_By_Region = sum ( Cum_N_By_Region, N ) ; endcomp ; compute after Chol ; Region_Age_PC = Cum_N_By_Region_Age / Total_N ; endcomp ; compute after Age ; Region_PC = Cum_N_By_Region / Total_N ; endcomp ; break after Region / skip summarize ; run; ods pdf close;