On Wed, 1 Jul 2009 11:09:36 -0700, Paul Miller <pjmiller_57@YAHOO.COM> wrote: .... >I'm interested in adding some label rows and some blank rows to a SAS dataset before submitting it to Proc Report. .... hi, Paul, In terms of coding style, we can make it a bit tighter like below. But I am not fully convinced that adding a blank row to the data is the best way to control output. Cheers, Chang /* test data */ data freqs; length diagnosis $30 category 8; retain diagnosis ""; do id = 1 to 15; count = id * 10; select; when (id<=6) category=1; when (id<=11) category=2; otherwise category=3; end; output; end; run; /* add some blank/label rows by category */ proc sort data=freqs; by category id; run; data freqs2; if 0 then set freqs; /* prep pdv */ length d $30; drop d; do d = "Type", "Stage", "Metastatic"; link diagnosis; /* DoW */ do until (last.category); set freqs; by category; output; end; if d ^= "Metastatic" then link blank; end; stop; diagnosis: diagnosis = catx(" ", "Cancer", d); output; call missing(diagnosis); return; blank: /* miss out all the vars except d */ call missing(category, id, count); output; return; run; /* check */ proc print data=freqs2; run; /* Obs diagnosis category id count 1 Cancer Type . . . 2 1 1 10 3 1 2 20 4 1 3 30 5 1 4 40 6 1 5 50 7 1 6 60 8 . . . 9 Cancer Stage . . . 10 2 7 70 11 2 8 80 12 2 9 90 13 2 10 100 14 2 11 110 15 . . . 16 Cancer Metastatic . . . 17 3 12 120 18 3 13 130 19 3 14 140 20 3 15 150 */