libname t '.'; data temp; set t.tomhs; if sex = 2 then female = 1; else female=0; if race = 2 then aa = 1; else aa = 0; if marital = 5 then married = 1; else if marital in(1,2,3,4) then married = 0; if educ in(7,8,9) then collgrad = 1; else if educ in(1,2,3,4,5,6) then collgrad = 0; if eversmk = 2 then nowsmk = 2; if nowsmk = 2 then nowsmk = 0; bmi = (wtbl*703.0768)/(height*height); pulsebl = 2*pulsebl; run; %let binary = female aa married collgrad nowsmk; %let cont = age alcdrkbl bmi dbpbl sbpbl pulsebl cholbl hdlbl glucosbl potassbl kcalbl fatbl probl chobl calcbl sodbl potbl; %breakdn(data=temp, class=sex 2T, var=age, out=out0); %breakdn(data=temp, class=sex 2T, var=&binary, out=out1); %breakdn(data=temp, class=sex 2T, var=&cont, out=out2); option mprint; %wreport(htmlfile = "&pname..htm"); %colset (20 11 11 2x 11 ); %move('
Example 1. Baseline characteristics by Gender in TOMHS
 ', col=1-0, line=1, fontsize=11pt,fontweight=bold); %move("pn=&pname rundate=&sysdate9", col=1-0, line=100, center=2); %move('Notes:   Values in table are mean ± SD or N (Percent)', col=1-0, line=92, center=2); %move('Men':'Women':'Total', col=2.0, line=9, fontweight=bold); %move('Demographics':'Behavior':'Clinical':'Laboratory':'Dietary Intake':'No. Participants', col=1, center=2, line=9 19 29 39 49 60, fontweight=bold, fontstyle=italic); %move('Age (y)':'Female (%)':'African American (%)':'Married (%)':'College Graduate (%)', col=1, center=2, indent=1, line=12L5); %move('Cigarette Smoker (%)':'Alcohol (Drinks/Week)', col=1, center=2, indent=1, line=22L2); %move('BMI (kg/m2)':'Diastolic BP (mm Hg)':'Systolic BP (mm Hg)':'Pulse (b/min)', col=1, center=2, indent=1, line=32L4); %move('Total Cholesterol (mg/dl)':'HDL Cholesterol (mg/dl)':'Glucose (mg/dl)':'Potassium (mg/dl)', col=1, center=2, indent=1, line=42L4); %move('Total Energy (kcal)':'Fat (%kcal)':'Protein (%kcal)':'Carbohydrates (%)':'Calcium (mg)':'Sodium (mg)':'Potassium (mg)', col=1, center=2, indent=1, line=52L7); set out0; %nmove(n1-n3, col=2.0, line=60, fmt=5.0, fontweight=bold); set out1; %nmove(sum1-sum15 m1-m15, col=2.4, line=13L4 22, combine=y, fchar=2P, fmt=5.0 5.1, scaler=1 100); set out2; %nmove(m1-m51 s1-s51, col=2.4, line=12 23 32L4 42L4 52L7, combine=y, fchar=1); stop; run; %makehtml(width=650px);