The script uses `goptions` to initialize graphics parameters. It opens an ODS HTML destination to save the graphical output to a `test.html` file. `PROC GBARLINE` is then used to create a chart overlaying bars (`product` by `sumvar=actual`) and a line (`sumvar=predict`). Finally, the ODS HTML destination is closed, completing the creation of the output file.
Data Analysis
Type : SASHELP
The data comes from the SASHELP library, specifically from the `PRDSALE` table, which contains product sales information.
1 Code Block
OPTIONS / ODS
Explanation : This block initializes the graphics options by resetting all parameters and specifying the ActiveX graphics device. It then configures the ODS HTML destination to save the graphical output to the `c:\workshop\hw06\test.html` file.
Copied!
goptions reset=all device=activex ;
ods html file='c:\workshop\hw06\test.html' ;
1
goptions reset=all device=activex ;
2
3
ods html file='c:\workshop\hw06\test.html' ;
4
2 Code Block
PROC GBARLINE
Explanation : This block uses `PROC GBARLINE` to create a combined chart. It takes data from the `sashelp.prdsale` table. The `bar product / sumvar=actual` clause generates a bar chart where each bar represents a `product` and its height is the sum of the `actual` variable. The `plot / sumvar=predict` clause overlays a line on the same chart, representing the sum of the `predict` variable.
Explanation : This block closes the previously opened ODS HTML destination, which finalizes the writing of the HTML file containing the chart.
Copied!
ods html close;
1
ods html 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.