1 / 16

Creating Drill-Down Graphs Using SAS/Graph and the Output Delivery System

Learn two approaches to create drill down graphs using SAS Graph and the Output Delivery System options. Explore ODS statement options and HTML and HTML Legend options.

blanca
Download Presentation

Creating Drill-Down Graphs Using SAS/Graph and the Output Delivery System

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Creating Drill-Down Graphs Using SAS/Graph and the Output Delivery System

  2. Options • Two approaches to create drill-down graphs • Method One • 1. GOPTIONS Statement Options, specifically DEVICE= Option • 2. ODS Statement Options • 3. HTML and HTML_Legend Options • 4. Data Step • Method Two • ODS Statement Options • Only works with JAVA device (Device=JAVA)

  3. GOPTIONS Statement Options • GOPTIONS Statement • One of the options with the GOPTIONS statement is the DEVICE= Option. This option determines the type of output you will get. The essential choices are: • ACTIVEX • JAVA • HTML, GIF, or JPEG • Over 150 Options available with GOPTIONS Statement, to view all of your default graphic options use the GOPTIONS Procedure

  4. ODS HTML Statement Options • ODS HTML Statement Options • BODY= • FRAME= • CONTENTS= • GPATH= • PATH= • STYLE= • GTITLE GFOOTNOTE • PARAMETERS=

  5. ODS HTML Statement Options • BODY= • Identifies the file that contains the HTML output. • You cannot open the HTML destination without specifying a body file. Therefore, BODY= is required if the HTML destination is closed, with: ODS HTML CLOSE; • CONTENTS= • Identifies the file that contains a table of contents to the HTML output. The contents file links to the body file. • FRAME= • Identifies the file that integrates the table of contents, the page contents, and the body file. If you open the frame file, you see a table of contents, a table of pages, or both, as well as the body file. • Several SubOptions are available , they provide instructions for writing the HTML files. You specify these options inside parentheses next to the file-specification in the BODY=, CONTENTS=, PAGE=, or FRAME= option.

  6. ODS HTML Statement Options • GPATH= • Specifies the destination for all graphics output that is generated while the HTML destination is open. • If you are using the DEVICE=HTML, GIF or JPEG it is important to tell SAS/GRAPH where to store the GIF/JPEG file it will create and associate it with the HTML file it will also create. • Note: If you do not specify SAS/GRAPH will place the graphics image in the SAS root folder. • PATH= • Specifies the location (an external file or a SAS catalog) for all HTML files. • STYLE= • Specifies the style definition to use in writing the HTML files.

  7. ODS HTML Statement Options • GFOOTNOTE/NOGFOOTNOTE • Controls the destination of the footnotes that are defined by the graphics program that generates the HTML output. GFOOTNOTE includes all the currently defined footnotes within the graphics output (the GIF file) that is called by the body file. NOGFOOTNOTE suppresses all the currently defined footnotes from appearing in the GIF files. Instead, they become part of the body file. • GTITLE/NOGTITLE • Controls the destination of the titles that are defined by the graphics program that generates the HTML output. GTITLE includes all the currently defined titles within the graphics output that is called by the body file. NOGTITLE suppresses all the currently defined titles from appearing in the graphics output. Instead, they become part of the body file.

  8. ODS HTML Statement Options “This option is the BIG one - take a deep breath” • PARAMETERS=(“parameter-name”=“parameter-value”) • DdLeveln - Specifies internal drill-down level specifications • DisableDrilldown - Specifies that the internal JAVA drill-down should be disabled for this graph. • DrillDownFuction\DrillFunc - Specifies the name of the JavaScript function to call when DrillDownMode is set to “Script”. • DrillDownMode - Specifies the drill-down mode to use when drilling down. The default is “Any”. • DrillPattern - Specifies the drill-down pattern when drill-down mode is HTML.

  9. ODS HTML Statement Options • DrillTarget - Specifies the drill-down window target to use when drilling down using HTML mode. The default is “_blank”. • HelpLocation - Specifies the URL from which the graph is to display help. The defualt is the help location for a particular applet release that SAS Institute provides on its external Web site. The parameter can be either “Default” or a valid URL. • Locale - Specifies the language and country to use when displaying locale-sensitive strings. • PatternStrip - Specifies that preceding and trailing white space are to be removed from drill-down substitution patterns.

  10. HTML and HTML_LEGEND Options Two critical options added to SAS/Graph Procedures • HTML = variable • Identifies the variable in the input data set whose values create links in the HTML file created by the ODS HTML Statement. These links are associated to an area in the chart and point to the data or graph you wish to display when the user drills down on the value. • HTML_LEGEND= • Identifies the variable in the input data set whose values create links in the HTML file created by the ODS HTML Statement. These links are associated with a legend value and point ot the data or graph you wish to display when the user drills down on the value.

  11. Sample Data

  12. Sample SAS Code /* CREATE A VARIABLE TO BUILD DRILL DOWN */ DATA BASEBALL; SET MYHOME.BASEBALL; LENGTH DIVISIONDRILL $40; IF LEAGUE = 'AMERICAN' AND DIVISION EQ 'WEST' THEN DIVISIONDRILL = 'HREF="divisionALwest_body.html"'; ELSE IF LEAGUE = 'AMERICAN' AND DIVISION EQ 'EAST' THEN DIVISIONDRILL = 'HREF="divisionALeast_body.html"'; ELSE IF LEAGUE = 'NATIONAL' AND DIVISION EQ 'EAST' THEN DIVISIONDRILL = 'HREF="divisionNLeast_body.html"'; ELSE IF LEAGUE = 'NATIONAL' AND DIVISION EQ 'WEST' THEN DIVISIONDRILL = 'HREF="divisionNLwest_body.html"'; ELSE IF LEAGUE = 'AMERICAN' AND DIVISION EQ 'CENTRAL' THEN DIVISIONDRILL = 'HREF="divisionALcentral_body.html"'; ELSE IF LEAGUE = 'NATIONAL' AND DIVISION EQ 'CENTRAL' THEN DIVISIONDRILL = 'HREF="divisionNLcentral_body.html"'; RUN;

  13. Sample SAS Code ODS LISTING CLOSE; GOPTIONS DEVICE=HTML NOBORDER; ODS HTML BODY='baseball_body.html' (TITLE="ODS Drill-Down Chart") FRAME='baseball_frame.html' CONTENTS='baseball_contents.html' PATH=ODSOUT GTITLE GFOOTNOTE STYLE=STATDOC GPATH = ’c:\valsug\’ PARAMETERS= ("ddlevel1" "disabledrilldown" = "true"); TITLE1 'Major League Baseball Home Run Statistics'; TITLE2 '2003 Season'; PROC GCHART DATA=BASEBALL; VBAR3D DIVISION / DISCRETE SUMVAR=NO_HOME GROUP=LEAGUE SUBGROUP=DIVISION SPACE=0 WIDTH=5 GSPACE=5 COUTLINE=BLACK CFRAME=PINK HTML=divisiondrill HTML_LEGEND=divisiondrill NAME='MASTER_G' DES='Home Run Statistics'; RUN;

  14. Sample SAS Code ODS HTML BODY='divisionALwest_body.html' PATH=odsout; TITLE1 'American West'; FORMAT TEAM $team.; WHERE LEAGUE='AMERICAN' and DIVISION='WEST'; VBAR3D TEAM / SUMVAR=NO_HOME TYPE=SUM GROUP=DIVISION SUBGROUP = TEAM AUTOREF SPACE=3 SHAPE=PRISM PATTERNiD=SUBGROUP COUTLINE=BLACK CFRAME=PINK NAME='ALWGRAPH' des = 'American League West 2003 Home Runs'; RUN; ODS HTML BODY='divisionALeast_body.html' PATH=odsout; TITLE1 'American East'; FORMAT TEAM $TEAM.; WHERE LEAGUE='AMERICAN' and DIVISION='EAST'; VBAR3D TEAM / SUMVAR=NO_HOME TYPE=SUM GROUP=DIVISION SUBGROUP = TEAM AUTOREF SPACE=3 SHAPE=PRISM PATTERNiD=SUBGROUP COUTLINE=BLACK CFRAME=PINK NAME='ALEGRAPH' des = 'American League East 2003 Home Runs'; RUN; … QUIT; ODS HTML CLOSE; ODS LISTING;

  15. DEVICE=JAVA • Method Two only requires the use of ODS parameter = values. You don’t have to create a SAS data set with HTML strings, and you don’t use the SAS/Graph HTML and HTML_Legend options.

  16. Conclusion • Creating drill-dowm graphs using SAS/Graph and ODS was easy. I was more frustrated with the SAS/Graph options to get my graph looking correct. Adding the information needed to make the graph drillable was not a problem - so if I can do it anyone can!

More Related