proc format; value vf 5 = 'GraphValueText'; run; data x1; array y[20] y0 - y19; do x = 1 to 20; y[x] = x - 0.5; end; do x = 0 to 10 by 5; output; end; label y0 = 'GraphLabelText' x = 'GraphLabelText' y18 = 'GraphLabelText'; format x y0 vf.; run; %macro d; %do i = 1 %to 12; reg y=y%eval(19-&i) x=x / lineattrs=GraphData&i markerattrs=GraphData&i curvelabel=" GraphData&i" curvelabelpos=max; %end; %mend; %macro l(i, l); reg y=y&i x=x / lineattrs=&l markerattrs=&l curvelabel=" &l" curvelabelpos=max; %mend; %macro makeplot; proc sgplot noautolegend data=x1; title "GraphTitleText - &st"; %d %l(19, GraphDataDefault) %l( 6, GraphFit) %l( 5, GraphFit2) %l( 4, GraphPredictionLimits) %l( 3, GraphConfidence) %l( 2, GraphGridLines) %l( 1, GraphOutlier) %l( 0, GraphReference) xaxis values=(0 5 10); run; %mend; ods _all_ close; ods exclude all; ods listing; proc template; ods output stats=styles; list styles; quit; ods exclude none; data _null_; set styles(where=(type='Style')); call execute(catx(' ', 'ods listing style=', path, ';')); call symputx('st', path); call execute(catx(' ', 'ods graphics on / reset=all imagename=', quote(cats(scan(path, 2))), ';')); call execute('%makeplot'); call execute('ods listing close;'); run; title; ods listing close; ods escapechar='~'; ods html file='styles.html'; data _null_; set styles(where=(type='Style')); call execute(cats('ods text="', path, '";')); call execute(cats("ods text=""~S={preimage='", scan(path, 2), ".png'", "}"";")); run; ods html close;