Uses the standard `sashelp.class` table for statistical data and the `maps.us` table for mapping data.
1 Code Block
INITIALIZATION
Explanation : Initialization of global graphic options and opening of the ODS HTMLPANEL destination for the creation of the 'composite.html' file.
Copied!
%let panelborder=1;
goptions reset=all dev=java;
ods tagsets.htmlpanel path="." (url=none) file="composite.html" style=default;
title1 "This is a graph panel title";
title2 "with a sub-title below it";
footnote1 "This is a panel footnote";
footnote2 "along with a sub-footnote";
Explanation : Start of a row panel and a first column. Generation of two pie charts (Age vs Height/Weight) vertically stacked in this first cell.
Copied!
/* Start a row panel, with a column panel in the first cell */
ods tagsets.htmlpanel event=row_panel(start);
/* Cell 1 */
ods tagsets.htmlpanel event=column_panel(start);
goptions xpixels=240 ypixels=240;
proc gchart data=sashelp.class;
pie age / sumvar=height;
run;
quit;
proc gchart data=sashelp.class;
pie age / sumvar=weight;
run;
quit;
/* Close the column panel */
ods tagsets.htmlpanel event=column_panel(finish);
1
/* Start a row panel, with a column panel in the first cell */
2
ods tagsets.htmlpanel event=row_panel(start);
3
4
/* Cell 1 */
5
ods tagsets.htmlpanel event=column_panel(start);
6
7
goptions xpixels=240 ypixels=240;
8
PROC GCHARTDATA=sashelp.class;
9
pie age / sumvar=height;
10
RUN;
11
QUIT;
12
13
PROC GCHARTDATA=sashelp.class;
14
pie age / sumvar=weight;
15
RUN;
16
QUIT;
17
18
/* Close the column panel */
19
ods tagsets.htmlpanel event=column_panel(finish);
3 Code Block
PROC GMAP
Explanation : Generation of a choropleth map of the United States in the second cell (implicit central column or continuation of the flow) with higher resolution.
Copied!
/* Cell 2 */
goptions xpixels=480 ypixels=480;
proc gmap map=maps.us data=maps.us;
id state;
choro state;
run;
quit;
1
/* Cell 2 */
2
goptions xpixels=480 ypixels=480;
3
PROC GMAP map=maps.us DATA=maps.us;
4
id state;
5
choro state;
6
RUN;
7
QUIT;
4 Code Block
PROC GCHART
Explanation : Creation of a third column containing two other pie charts based on the mean. Closing of the column and the global row.
Copied!
/* Cell 3 */
ods tagsets.htmlpanel event=column_panel(start);
goptions xpixels=240 ypixels=240;
proc gchart data=sashelp.class;
pie age / sumvar=height type=mean;
run;
quit;
proc gchart data=sashelp.class;
pie age / sumvar=weight type=mean;
run;
quit;
/* Close the column panel */
ods tagsets.htmlpanel event=column_panel(finish);
/* Close the whole panel */
ods tagsets.htmlpanel event=row_panel(finish);
1
/* Cell 3 */
2
ods tagsets.htmlpanel event=column_panel(start);
3
goptions xpixels=240 ypixels=240;
4
PROC GCHARTDATA=sashelp.class;
5
pie age / sumvar=height type=mean;
6
RUN;
7
QUIT;
8
9
PROC GCHARTDATA=sashelp.class;
10
pie age / sumvar=weight type=mean;
11
RUN;
12
QUIT;
13
14
/* Close the column panel */
15
ods tagsets.htmlpanel event=column_panel(finish);
16
/* Close the whole panel */
17
ods tagsets.htmlpanel event=row_panel(finish);
5 Code Block
PROC SORT Data
Explanation : Sorting of `sashelp.class` data by sex and age, stored in a temporary table `temp`.
Copied!
title1 "This is a table example";
goptions xpixels=340 ypixels=335;
proc sort data=sashelp.class out=temp;
by sex age;
run;
1
title1 "This is a table example";
2
goptions xpixels=340 ypixels=335;
3
PROC SORTDATA=sashelp.class out=temp;
4
BY sex age;
5
RUN;
6 Code Block
ODS LAYOUT MIXTE
Explanation : Creation of a second composite panel combining a horizontal bar chart (HBAR) in the first column and a data table (PROC PRINT) in the second. Closing of all ODS destinations.
Copied!
/* Start a row panel, with a column panel in the first cell */
ods tagsets.htmlpanel event=row_panel(start);
/* Cell 1 */
ods tagsets.htmlpanel event=column_panel(start);
proc gchart data=temp;
by sex;
hbar age / discrete sumvar=weight type=mean;
run;
quit;
/* Close the column panel */
ods tagsets.htmlpanel event=column_panel(finish);
/* Cell 2 */
proc print data=temp;
run;
quit;
/* Close the whole panel */
ods tagsets.htmlpanel event=row_panel(finish);
ods _all_ close;
1
/* Start a row panel, with a column panel in the first cell */
2
ods tagsets.htmlpanel event=row_panel(start);
3
4
/* Cell 1 */
5
ods tagsets.htmlpanel event=column_panel(start);
6
PROC GCHARTDATA=temp;
7
BY sex;
8
hbar age / discrete sumvar=weight type=mean;
9
RUN;
10
QUIT;
11
12
/* Close the column panel */
13
ods tagsets.htmlpanel event=column_panel(finish);
14
15
/* Cell 2 */
16
PROC PRINTDATA=temp;
17
RUN;
18
QUIT;
19
20
/* Close the whole panel */
21
ods tagsets.htmlpanel event=row_panel(finish);
22
23
ods _all_ close;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.