Hi:
If you're going to put the color variable and the MISSNUM variable in a dataset, then it will be fairly easy to write the PROC REPORT code to do the highlighting as you show. The challenge is going to come in when you want to add the break lines. PROC REPORT will not arbitrarily insert blank lines into a report. PROC REPORT can only insert break lines at a break between group or order variables. So, the issue with what you show is that you are going to need some helper variables to do break processing.
However, you do not need to create a separate color variable in the dataset, but you will need to create a separate ordering/breaking variable. In my approach, I used a global macro variable to hold the value of MISSNUM=4 and then used that macro variable in the PROC REPORT COMPUTE block.
Note that I also used an extra variable called ORDVAR in the original data creation program to ensure the order of the rows so that you could use a LINE statement to insert the blank line.
Here's an example of the ORDVAR helper variable I used:
data fakedata;
length stats $4;
infile datalines dlm=',' dsd;
input ordvar $ stats $ count num;
if stats = 'Miss' and Count = . then do;
call symputx('wantnum',put(num,2.0),'G');
end;
cards;
A,Miss,1,1
A,Miss,2,4
A,Miss,3,2
A,Miss,4,2
B,Miss,.,4
C,Min,.,1
C,Max,.,4
;
run;
Then having the macro variable and the helper variable ORDVAR allowed me to run this PROC REPORT:
Cynthia
... View more