I'm making several png image using sgplot and the by statement like this:
ods html path="&graphPath" body="index.html"
image_dpi=300 style=sciensano1 device=png;
ods graphics on / reset noborder imagename="boom"
height=10cm width=16cm ;
title;footnote;
options byline;
proc sgplot data=sashelp.class;
histogram height;
by Sex;
run;quit;
ods html close;
This creates 1 html file (index.html)
and 2 png files (boom1.png & boom3.png)
I'm wondering if it's possible to name the png files according to the by values.
Similarly as adding #byval in the title for example.
Currently, number are added automatically to the imagename from the ods graphics, I would like to get rid of the numbers and use the byval instead.
The only solution I have so far is to make all graphs individually, using a %do loop in a macro, this way I can parametrize the imagename and give it a macro variable name. The problem with that is that it's much more complex to implement and much slower.
EDIT: Using SAS 9.3
In my SAS 9.4M4, there is no such feature in
SGPLOTHISTOGRAMoptions, nor inODS GRAPHICSIMAGENAMEorINDEX.Ideally, a future release would see ODS honor
#BYVALand#BYVARsubstitution options.or
Fall back:
The
GCHARTProcedure statements, such asVBARsupport thename=option which honors the#BYVALsubstitution option.