** HTML STYLES **;
* CREATE A DATASET WITH THE STYLE NAMES;
ods listing close;
ODS OUTPUT Stats(MATCH_ALL=mvar)=Temp1;
proc template;
list;
run;
ODS OUTPUT CLOSE;
data TemplateListing;
length type $12 path $255;
set &mvar;
if type="Style";
run;
title;
title1;
title2;
title3;
* CREATE MACRO VARIABLES FROM THE STYLE NAMES;
data _null_;
set TemplateListing end=eof;
retain Counter 1;
if eof then call symput('NumStyles',Counter);
StyleName=Path;
StyleNum=trim(left(compress("Style"||Counter)));
call symput(StyleNum,StyleName);
Counter+1;
run;
* CREATE A SIMPLE DATASET;
Data Test;
input A B C;
cards;
1 2 3
4 5 6
7 8 9
;
run;
* LOOP THROUGH THE STYLES RUNNING A SIMPLE PROCEDURE;
** HTML STYLES **;
%Macro DisplayStyles;
ODS LISTING CLOSE;
ODS HTML FRAME="c:\styletestframe.html"
CONTENTS="c:\styletestcont.html"
BODY="c:\styletestjunk.html";
%Do C=1 %to &NumStyles;
ODS HTML BODY="c:\styletest&C..html" style=&&Style&C;
title 'Available Styles';
title2 "This Style is &&Style&C";
ODS PROCLABEL "This Style is &&Style&C";
proc print data=Test;
run;
%End;
ODS HTML CLOSE;
%Mend DisplayStyles;
%DisplayStyles;
*********************************************************;