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;
/* 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.");
/* Subset DSIN into WATERFALL & sort */
proc sort data=waterfall;
by &byvar. descending &yvar.;
/* 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;*/
proc sgplot data=waterfall;
needle x=n y=&yvar. / group=&byvar. lineattrs=(thickness=&barwidth.);
keylegend / across=1 position=topleft location=inside;
yaxis grid values=(-100 to 150 by 50) label="&ylab.";
ods pdf close;
/* proc datasets lib=work;*/
/* delete waterfall;*/
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.