Hi:
Although you could do this with PROC REPORT, I think that the DATA step is better at controlling what gets written in the manner you describe. PROC REPORT will want to execute a BREAK statement for EVERY break variable group (every month, for example) and while you COULD control that by making a dummy break variable for MTD and YTD break points, you'd have to make a dummy break variable in the DATA step and as long as you were in the DATA step, you may as well write your report there.
The report results from the below program are too lengthy to display, but if you run the program and carefully examine the rows being written, especially, the MTD and YTD rows, you should be able to figure out how to use DATA step IF statements to control what gets written out to the ODS HTML (or RTF or PDF) file. (SASHELP.PRDSALE does not have daily sales -- which is why I showed the product -- so there would be multiple obs in a single month -- they're just for product instead of for each day.)
cynthia
[pre]
** create a subset of data;
proc sort data=sashelp.prdsale out=prdsale;
where year = 1994 and (month between '01JAN94'd and '31OCT94'd)
and country = 'U.S.A.';
by month;
run;
ods listing close;
options nodate nonumber missing = ' ';
ods html file='somebreak.html' style=sasweb;
data _null_;
set prdsale end=eof;
by month;
** read in the data file, set the END= variable;
** housekeeping -- want month name to be a character var;
** and want to retain monthly total and overall total;
length prtmonth $15;
retain alltot montot 0;
** create PRTMONTH character variable;
prtmonth = put(month,monname3.);
** at first obs for every month, initialize monthly total var to 0;
if first.month then montot = 0;
** accumulate overall total and monthly total;
alltot = alltot + actual;
montot = montot + actual;
** display each row in the data;
** only show 4 variables -- but only summing up on ACTUAL;
** the put _ods_ will write out these 4 variables for every data row;
file print ods=(variables=(prtmonth actual predict product));
put _ods_;
** For June and Oct, write out the MTD total just for that month;
** and do NOT write out PREDICT or PRODUCT on the monthly summary line;
if last.month then do;
if prtmonth in ('Jun','Oct') then do;
prtmonth = 'MTD Total';
put @1 prtmonth @2 montot;
end;
** After every month is finished, write out a blank separator line;
put ' ';
end;
** at the end of the file, write out the YTD Total;
if eof then do;
prtmonth = 'YTD Total';
put @1 prtmonth @2 alltot;
end;
format prtmonth $15. montot alltot actual predict dollar14.;
label prtmonth = 'Month';
run;
ods html close;
[/pre]