I must have some kind of option turned on that I am not seeing, but when I run the macro shown below, the output is produced in the HTML results viewer as well as in the stored .RTF file that I specify. Attached are the two outputs (I couldn't attach the RTF, so the same is in PDF). I want the HTML look in the RTF file. Is there a reason why the HTML shows colored bars while the RTF shows B&W line patterns? %macro waterfall(dsin=, whr=%str(), yvar=, byvar=, title=%str(), ylab=%str(), outpath=%str(), filename=%str(), barwidth=3); /* Display error message if WATERFALL dataset is attempting to be overwritten */ %if %sysfunc(upcase(&dsin.))=WATERFALL %then %do; %put ERROR: The dataset WATERFALL is used in the waterfall macro. Please rename your input dataset and rerun the macro; %return; %end; /* Get variable type and format of BYVAR */ proc sql noprint; select type, format into :vartyp, :varfmt from sashelp.vcolumn where upcase(memname)=upcase("&dsin.") & upcase(name)=upcase("&byvar."); quit; /* Subset DSIN into WATERFALL & sort */ data waterfall; set &dsin.; where &whr.; run; proc sort data=waterfall; by &byvar. descending &yvar.; run; data waterfall; set waterfall; n=_n_; run; /* Create waterfall plot */ options formchar="|____|+|___+=|_/\<>*" pageno=1 nonumber nodate orientation=landscape center; ods listing close; ods pdf file="&outpath.\&filename..pdf" style=journal; /* goptions reset=all ftext=swissl ftitle=swissl hsize=9 in vsize=6.5 in;*/ title1 "&title."; proc sgplot data=waterfall; where &yvar.^=.; needle x=n y=&yvar. / group=&byvar. lineattrs=(thickness=&barwidth.); refline 0; keylegend / across=1 position=topleft location=inside; xaxis display=none; yaxis grid values=(-100 to 150 by 50) label="&ylab."; run; quit; ods pdf close; ods listing; title; footnote; /* proc datasets lib=work;*/ /* delete waterfall;*/ /* run;*/ quit; %mend waterfall;
... View more