SAS ODS HTML

5,637 views

Published on

Learning
Base SAS,
Advanced SAS,
Proc SQl,
ODS,
SAS in financial industry,
Clinical trials,
SAS Macros,
SAS BI,
SAS on Unix,
SAS on Mainframe,
SAS interview Questions and Answers,
SAS Tips and Techniques,
SAS Resources,
SAS Certification questions...

visit http://sastechies.blogspot.com

Published in: Technology, Design
1 Comment
11 Likes
Statistics
Notes
No Downloads
Views
Total views
5,637
On SlideShare
0
From Embeds
0
Number of Embeds
14
Actions
Shares
0
Downloads
0
Comments
1
Likes
11
Embeds 0
No embeds

No notes for slide
  • SASTechies.com Sharad C Narnindi Attic Technologies,Inc 2005
  • SASTechies.com Sharad C Narnindi Attic Technologies,Inc 2005
  • SASTechies.com Sharad C Narnindi Attic Technologies,Inc 2005
  • SASTechies.com Sharad C Narnindi Attic Technologies,Inc 2005
  • SASTechies.com Sharad C Narnindi Attic Technologies,Inc 2005
  • SASTechies.com Sharad C Narnindi Attic Technologies,Inc 2005
  • SASTechies.com Sharad C Narnindi Attic Technologies,Inc 2005
  • SASTechies.com Sharad C Narnindi Attic Technologies,Inc 2005
  • SASTechies.com Sharad C Narnindi Attic Technologies,Inc 2005
  • SASTechies.com Sharad C Narnindi Attic Technologies,Inc 2005
  • SASTechies.com Sharad C Narnindi Attic Technologies,Inc 2005
  • SASTechies.com Sharad C Narnindi Attic Technologies,Inc 2005
  • SASTechies.com Sharad C Narnindi Attic Technologies,Inc 2005
  • SASTechies.com Sharad C Narnindi Attic Technologies,Inc 2005
  • SASTechies.com Sharad C Narnindi Attic Technologies,Inc 2005
  • SASTechies.com Sharad C Narnindi Attic Technologies,Inc 2005
  • SASTechies.com Sharad C Narnindi Attic Technologies,Inc 2005
  • SASTechies.com Sharad C Narnindi Attic Technologies,Inc 2005
  • SASTechies.com Sharad C Narnindi Attic Technologies,Inc 2005
  • SASTechies.com Sharad C Narnindi Attic Technologies,Inc 2005
  • SASTechies.com Sharad C Narnindi Attic Technologies,Inc 2005
  • SASTechies.com Sharad C Narnindi Attic Technologies,Inc 2005
  • SASTechies.com Sharad C Narnindi Attic Technologies,Inc 2005
  • SAS ODS HTML

    1. 1. SASTechies [email_address] http://www.sastechies.com
    2. 2. <ul><li>Creating </li></ul><ul><ul><li>SAS Tables, </li></ul></ul><ul><ul><li>Listings, </li></ul></ul><ul><ul><li>Basic Statistics Procedures with SAS </li></ul></ul><ul><ul><li>Graphs </li></ul></ul><ul><ul><li>ODS HTML </li></ul></ul><ul><ul><li>Proc Report and Other Utility Procedures </li></ul></ul>11/13/09 SAS Techies 2009 TLG’s
    3. 3. <ul><ul><li>Using the SAS Output Delivery System (ODS) , you can create, customize, and manage HTML output in any operating environment by submitting programming statements. </li></ul></ul>11/13/09 SAS Techies 2009
    4. 4. <ul><ul><li>ODS creates your output in the form of output objects . Each output object contains the results of a procedure or DATA step (the data component ) and may also contain information about how to render the results (the table definition ). </li></ul></ul><ul><ul><li>ODS sends the output object to the destination(s) you specified and creates SAS data sets , listing output , or HTML output as appropriate. </li></ul></ul>11/13/09 SAS Techies 2009
    5. 5. <ul><ul><li>ODS creates a link to each output object in the Results window and identifies each output object by the appropriate icon. </li></ul></ul>11/13/09 SAS Techies 2009
    6. 6. <ul><li>By default, the Listing destination is open </li></ul><ul><li>Use </li></ul><ul><li>ods listing close; - to close </li></ul><ul><li>ods listing; - to open </li></ul><ul><li>the Output and HTML destinations are closed . </li></ul><ul><li>ods html; - to open </li></ul><ul><li>Out=data options invokes the output dest. </li></ul>11/13/09 SAS Techies 2009
    7. 7. <ul><ul><li>FRAME= file-specification </li></ul></ul><ul><ul><ul><li>identifies the file that integrates the table of contents, the page contents, and the body file. If you specify FRAME=, you must specify CONTENTS= or PAGE= or both. </li></ul></ul></ul><ul><li>ODS HTML         HTML-file-specification(s)   < option(s )> ; where </li></ul><ul><ul><li>HTML-file-specification(s) opens the HTML destination and specifies the file to write to. The file remains open until you either specify a new file or close the HTML destination by submitting this form of the ODS HTML statement:      ODS HTML CLOSE; The specifications for these files can be the following: </li></ul></ul><ul><ul><li>BODY= file-specification </li></ul></ul><ul><ul><ul><li>identifies the file that contains the HTML output. </li></ul></ul></ul><ul><ul><li>CONTENTS= file-specification </li></ul></ul><ul><ul><ul><li>identifies a table of contents that links to the body file. </li></ul></ul></ul><ul><ul><li>PAGE= file-specification </li></ul></ul><ul><ul><ul><li>identifies the file that contains a description of each page of the body file and links to the body file. </li></ul></ul></ul>11/13/09 SAS Techies 2009
    8. 8. <ul><ul><li>ods listing close; </li></ul></ul><ul><ul><li>ods html body='c: ecordsdata.html' contents='c: ecords oc.html' frame='c: ecordsframe.html'; </li></ul></ul><ul><ul><li>proc print data=clinic.admit label; </li></ul></ul><ul><ul><li>var sex age height weight actlevel; </li></ul></ul><ul><ul><li>label actlevel='Activity Level'; run; </li></ul></ul><ul><ul><li>proc print data=clinic.stress2; </li></ul></ul><ul><ul><li>var id resthr maxhr rechr; run; </li></ul></ul><ul><ul><li>ods html close; ods listing; </li></ul></ul><ul><ul><li>Below each heading is a link to the body file by a procedure. Select a link in the table of contents to display the corresponding body file. </li></ul></ul>11/13/09 SAS Techies 2009
    9. 9. <ul><ul><li>URL= suboption in a file specification: HTML-file-specification (URL='  Uniform-Resource-Locator ') where </li></ul></ul><ul><ul><li>HTML-file-specification opens the HTML destination and specifies the file to write to. Use the URL= suboption in any ODS file specification except FRAME= (because no ODS file references the frame file ). </li></ul></ul><ul><ul><li>Uniform-Resource-Locator provides a URL for HTML-file-specification. ODS uses this URL instead of the file name in all the links and references that it creates that point to the file. </li></ul></ul><ul><ul><li>URL= is useful for building HTML files that may be moved from one location to another. If the links from the contents and page files are constructed with a simple URL (one name), they work as long as the contents, page, and body files are all in the same location. </li></ul></ul>11/13/09 SAS Techies 2009
    10. 10. <ul><ul><li>Relative URLs In this ODS HTML statement, URL= specifies simple URLs (one name). These files must be stored in the same location. </li></ul></ul><ul><ul><li>ods html body='c: ecordsdata.html' (url='data.html') contents='c: ecords oc.html' (url='toc.html') frame='c: ecordsframe.html'; </li></ul></ul>11/13/09 SAS Techies 2009
    11. 11. <ul><li>you want to display these files from a Web server. </li></ul><ul><li>Absolute URLs Alternately, in this ODS HTML statement, the URL= suboptions specify complete URLs using the HTTP protocol. These files can be stored in the same or different locations. </li></ul><ul><ul><li>ods html body='c: ecordsdata.html' (url='http://mysite.com/myreports/data.html’) </li></ul></ul><ul><ul><li>contents='c: ecords oc.html' (url='http://mysite.com/mycontents/toc.html') frame='c: ecordsframe.html'; </li></ul></ul>11/13/09 SAS Techies 2009
    12. 12. <ul><ul><li>STYLE= style-name where style-name is the name of a valid SAS or user-defined style definition. </li></ul></ul><ul><ul><li>Don't enclose style-name in quotation marks. </li></ul></ul><ul><ul><li>ods listing close; </li></ul></ul><ul><ul><li>ods html </li></ul></ul><ul><ul><li>body='c: ecordsdata.html'(url='data.html') </li></ul></ul><ul><ul><li>contents='c: ecords oc.html'(url='toc.html‘) </li></ul></ul><ul><ul><li>frame='c: ecordsframe.html' </li></ul></ul><ul><ul><li>style=beige; </li></ul></ul><ul><ul><li>proc print data=clinic.admit label; var id sex age height weight actlevel; label actlevel='Activity Level'; run; </li></ul></ul><ul><ul><li>proc print data=clinic.stress2; var id resthr maxhr rechr; run; </li></ul></ul><ul><ul><li>ods html close; ods listing; </li></ul></ul>11/13/09 SAS Techies 2009 Obs ID Name Sex Age Date Height Weight ActLevel Fee 1 2458 Murray, W M 27 1 72 168 HIGH 85.20 2 2462 Almers, C F 34 3 66 152 HIGH 124.80 3 2501 Bonaventure, T F 31 17 61 123 LOW 149.75 4 2523 Johnson, R F 43 31 63 137 MOD 149.75 5 2539 LaMance, K M 51 4 71 158 LOW 124.80 6 2544 Jones, M M 29 6 76 193 HIGH 124.80 7 2552 Reberson, P F 32 9 67 151 MOD 149.75 8 2555 King, E M 35 13 70 173 MOD 149.75 9 2563 Pitts, D M 34 22 73 154 LOW 124.80 10 2568 Eberhardt, S F 49 27 64 172 LOW 124.80
    13. 13. <ul><li>ods listing close; </li></ul><ul><li>ods html path='c: ecords'(url=none) </li></ul><ul><li>body='data.html' </li></ul><ul><li>contents='toc.html' frame='frame.html'; </li></ul><ul><li>style=brick; </li></ul><ul><li>ods html path= 'http://mysite.com/myreports/’ (url=none) </li></ul><ul><li>body='data.html' </li></ul><ul><li>contents='toc.html' </li></ul><ul><li>frame='frame.html'; </li></ul><ul><li>style=brick; </li></ul><ul><li>When you use the PATH= option, you don't need to specify the full path name for the body, contents, or frame files. </li></ul><ul><li>PATH= file-specification   </li></ul><ul><li>  <( URL= ' Uniform-Resource-Locator ' | NONE )> </li></ul>11/13/09 SAS Techies 2009
    14. 14. 11/13/09 SAS Techies 2009 / style={background=lib} font_style=italic} ; Laguardia Flights by Destination and Revenue, March 4-10   Min Max Mean Sum Destination   81 154 131 786 Copenhagen Boarded Transferred 5 21 13 75 Deplaned 103 177 147 881 Revenue 109,885 196,540 139,951 839,705 Frankfurt Boarded 129 210 170 1,190 Transferred 5 22 13 91 Deplaned 147 237 188 1,314 Revenue 100,987 187,636 142,912 1,000,382 London Boarded 151 241 188 3,760 Transferred 4 18 11 227 Deplaned 114 250 199 3,987 Revenue 106,753 198,744 159,478 3,189,554 Paris Boarded 146 182 161 2,089 Transferred 7 29 16 204 Deplaned 153 227 183 2,378 Revenue 123,456 195,468 151,477 1,969,201   Min Max Mean Sum Destination   81 154 131 786 Copenhagen Boarded Transferred 5 21 13 75 Deplaned 103 177 147 881 Revenue 109,885 196,540 139,951 839,705 Frankfurt Boarded 129 210 170 1,190 Transferred 5 22 13 91 Deplaned 147 237 188 1,314 Revenue 100,987 187,636 142,912 1,000,382 London Boarded 151 241 188 3,760 Transferred 4 18 11 227 Deplaned 114 250 199 3,987 Revenue 106,753 198,744 159,478 3,189,554 Paris Boarded 146 182 161 2,089 Transferred 7 29 16 204 Deplaned 153 227 183 2,378 Revenue 123,456 195,468 151,477 1,969,201
    15. 15. <ul><li>ods listing close; </li></ul><ul><li>ods html path='c:data' body='laguard.html'; title1 'Laguardia Flights by Destination'; </li></ul><ul><li>title2 'and Revenue, March 4-10'; </li></ul><ul><li>proc format; </li></ul><ul><li>value $desname </li></ul><ul><ul><li>'CPH'='Copenhagen' </li></ul></ul><ul><ul><li>'FRA'='Frankfurt' </li></ul></ul><ul><ul><li>'LON'='London' </li></ul></ul><ul><ul><li>'PAR'='Paris'; </li></ul></ul><ul><li>value $desback </li></ul><ul><li>'CPH'='cxBBDDCC‘ </li></ul><ul><li>'FRA'='cxAACCBB' </li></ul><ul><li>'LON'='cx99BBAA‘ </li></ul><ul><li>'PAR'='cx88AA99'; </li></ul><ul><li>value deplback </li></ul><ul><li>low-105='lipk' </li></ul><ul><li>245-250='vpapb' </li></ul><ul><li>other='ywh'; </li></ul><ul><li>run; </li></ul><ul><li>proc tabulate data=flights.laguardia format=comma9. style={background=ywh}; class dest / style={background=cxCCEEDD font_style=italic}; </li></ul><ul><li>classlev dest / style={background=$desback.}; </li></ul><ul><li>var boarded transferred deplaned / style={background=cxCCEEDD}; </li></ul><ul><li>var revenue / style=<parent>{foreground=black}; </li></ul><ul><li>table dest*(boarded transferred deplaned *{style={background=deplback.}} revenue*{style=<parent>}),min max mean sum / box={style={background=cxCCEEDD}}; </li></ul><ul><li>keyword min max mean sum / style={background=cxCCEEDD font_style=italic}; label dest='Destination'; </li></ul><ul><li>format dest $desname.; </li></ul><ul><li>run; </li></ul><ul><li>ods html close; </li></ul><ul><li>ods listing; </li></ul>11/13/09 SAS Techies 2009 Laguardia Flights by Destination and Revenue, March 4-10   Min Max Mean Sum Destination   81 154 131 786 Copenhagen Boarded Transferred 5 21 13 75 Deplaned 103 177 147 881 Revenue 109,885 196,540 139,951 839,705 Frankfurt Boarded 129 210 170 1,190 Transferred 5 22 13 91 Deplaned 147 237 188 1,314 Revenue 100,987 187,636 142,912 1,000,382 London Boarded 151 241 188 3,760 Transferred 4 18 11 227 Deplaned 114 250 199 3,987 Revenue 106,753 198,744 159,478 3,189,554 Paris Boarded 146 182 161 2,089 Transferred 7 29 16 204 Deplaned 153 227 183 2,378 Revenue 123,456 195,468 151,477 1,969,201
    16. 16. 11/13/09 SAS Techies 2009 keyword min max mean sum / style={background=cxCCEEDD};   Min Max Mean Sum Destination   81 154 131 786 Copenhagen Boarded Transferred 5 21 13 75 Deplaned 103 177 147 881 Revenue 109,885 196,540 139,951 839,705 Frankfurt Boarded 129 210 170 1,190 Transferred 5 22 13 91 Deplaned 147 237 188 1,314 Revenue 100,987 187,636 142,912 1,000,382 London Boarded 151 241 188 3,760 Transferred 4 18 11 227 Deplaned 114 250 199 3,987 Revenue 106,753 198,744 159,478 3,189,554 Paris Boarded 146 182 161 2,089 Transferred 7 29 16 204 Deplaned 153 227 183 2,378 Revenue 123,456 195,468 151,477 1,969,201 Laguardia Flights by Destination and Revenue, March 4-10   Min Max Mean Sum Destination   81 154 131 786 Copenhagen Boarded Transferred 5 21 13 75 Deplaned 103 177 147 881 Revenue 109,885 196,540 139,951 839,705 Frankfurt Boarded 129 210 170 1,190 Transferred 5 22 13 91 Deplaned 147 237 188 1,314 Revenue 100,987 187,636 142,912 1,000,382 London Boarded 151 241 188 3,760 Transferred 4 18 11 227 Deplaned 114 250 199 3,987 Revenue 106,753 198,744 159,478 3,189,554 Paris Boarded 146 182 161 2,089 Transferred 7 29 16 204 Deplaned 153 227 183 2,378 Revenue 123,456 195,468 151,477 1,969,201
    17. 17. 11/13/09 SAS Techies 2009 / box={style={background=cxCCEEDD}}; [BOX cell]   Min Max Mean Sum Destination   81 154 131 786 Copenhagen Boarded Transferred 5 21 13 75 Deplaned 103 177 147 881 Revenue 109,885 196,540 139,951 839,705 Frankfurt Boarded 129 210 170 1,190 Transferred 5 22 13 91 Deplaned 147 237 188 1,314 Revenue 100,987 187,636 142,912 1,000,382 London Boarded 151 241 188 3,760 Transferred 4 18 11 227 Deplaned 114 250 199 3,987 Revenue 106,753 198,744 159,478 3,189,554 Paris Boarded 146 182 161 2,089 Transferred 7 29 16 204 Deplaned 153 227 183 2,378 Revenue 123,456 195,468 151,477 1,969,201 Laguardia Flights by Destination and Revenue, March 4-10   Min Max Mean Sum Destination   81 154 131 786 Copenhagen Boarded Transferred 5 21 13 75 Deplaned 103 177 147 881 Revenue 109,885 196,540 139,951 839,705 Frankfurt Boarded 129 210 170 1,190 Transferred 5 22 13 91 Deplaned 147 237 188 1,314 Revenue 100,987 187,636 142,912 1,000,382 London Boarded 151 241 188 3,760 Transferred 4 18 11 227 Deplaned 114 250 199 3,987 Revenue 106,753 198,744 159,478 3,189,554 Paris Boarded 146 182 161 2,089 Transferred 7 29 16 204 Deplaned 153 227 183 2,378 Revenue 123,456 195,468 151,477 1,969,201
    18. 18. 11/13/09 SAS Techies 2009 class dest / style={background=cxCCEEDD}; classlev dest / style={background=cxAACCBB};   Min Max Mean Sum Destination   81 154 131 786 Copenhagen Boarded Transferred 5 21 13 75 Deplaned 103 177 147 881 Revenue 109,885 196,540 139,951 839,705 Frankfurt Boarded 129 210 170 1,190 Transferred 5 22 13 91 Deplaned 147 237 188 1,314 Revenue 100,987 187,636 142,912 1,000,382 London Boarded 151 241 188 3,760 Transferred 4 18 11 227 Deplaned 114 250 199 3,987 Revenue 106,753 198,744 159,478 3,189,554 Paris Boarded 146 182 161 2,089 Transferred 7 29 16 204 Deplaned 153 227 183 2,378 Revenue 123,456 195,468 151,477 1,969,201 Laguardia Flights by Destination and Revenue, March 4-10   Min Max Mean Sum Destination   81 154 131 786 Copenhagen Boarded Transferred 5 21 13 75 Deplaned 103 177 147 881 Revenue 109,885 196,540 139,951 839,705 Frankfurt Boarded 129 210 170 1,190 Transferred 5 22 13 91 Deplaned 147 237 188 1,314 Revenue 100,987 187,636 142,912 1,000,382 London Boarded 151 241 188 3,760 Transferred 4 18 11 227 Deplaned 114 250 199 3,987 Revenue 106,753 198,744 159,478 3,189,554 Paris Boarded 146 182 161 2,089 Transferred 7 29 16 204 Deplaned 153 227 183 2,378 Revenue 123,456 195,468 151,477 1,969,201
    19. 19. <ul><li>ods listing close; ods html path='c:data' body='laguard.html'; title1 'Laguardia Flights by Destination'; title2 'and Revenue, March 4-10'; </li></ul><ul><li>proc format; </li></ul><ul><li>value $desname </li></ul><ul><li>'CPH'=' <DIV>Copenhagen<P><IMG src=&quot;denmark.gif&quot;></DIV> ' 'FRA'=' <DIV>Frankfurt<P><IMG src=&quot;germany.gif&quot;></DIV> ' 'LON'=' <DIV>London<P><IMG src=&quot;uk.gif&quot;></DIV> ' 'PAR'=' <DIV>Paris<P><IMG src=&quot;france.gif&quot;></DIV> '; </li></ul><ul><li>value $desback </li></ul><ul><li>'CPH'='cxBBDDCC' </li></ul><ul><li>'FRA'='cxAACCBB' </li></ul><ul><li>'LON'='cx99BBAA' </li></ul><ul><li>'PAR'='cx88AA99'; </li></ul><ul><li>value deplback </li></ul><ul><ul><li>low-105='lipk' </li></ul></ul><ul><ul><li>245-250='vpapb' </li></ul></ul><ul><ul><li>other='ywh'; </li></ul></ul><ul><li>value deplflyo </li></ul><ul><ul><li>low-105='LOW traffic. Cut flights?' </li></ul></ul><ul><ul><li>245-250='HIGH traffic. Add flights?' </li></ul></ul><ul><ul><li>other=' '; </li></ul></ul><ul><ul><li>run; </li></ul></ul><ul><li>proc tabulate data=flights.laguardia format=comma9. style={background=ywh}; class dest / style={background=cxCCEEDD font_style=italic}; classlev dest / style={background=$desback.}; </li></ul><ul><li>var boarded transferred deplaned / style={background=cxCCEEDD}; </li></ul><ul><li>var revenue / style=<parent>{foreground=black}; </li></ul><ul><li>table dest*(boarded transferred deplaned*{style={background=deplback. flyover=deplflyo.}} revenue*{style=<parent>}),min max mean sum / box={style={background=cxCCEEDD}}; </li></ul><ul><li>keyword min max mean sum / style={background=cxCCEEDD font_style=italic}; </li></ul><ul><li>label dest='Destination'; format dest $desname.; run; </li></ul><ul><li>ods html close; </li></ul><ul><li>ods listing; </li></ul>11/13/09 SAS Techies 2009 Laguardia Flights by Destination and Revenue, March 4-10   Min Max Mean Sum Destination   81 154 131 786 Copenhagen                 Boarded Transferred 5 21 13 75 Deplaned 103 177 147 881 Revenue 109,885 196,540 139,951 839,705 Frankfurt                 Boarded 129 210 170 1,190 Transferred 5 22 13 91 Deplaned 147 237 188 1,314 Revenue 100,987 187,636 142,912 1,000,382 London                 Boarded 151 241 188 3,760 Transferred 4 18 11 227 Deplaned 114 250 199 3,987 Revenue 106,753 198,744 159,478 3,189,554 Paris                 Boarded 146 182 161 2,089 Transferred 7 29 16 204 Deplaned 153 227 183 2,378 Revenue 123,456 195,468 151,477 1,969,201
    20. 20. <ul><li>To create a drill-down graph, you write a SAS program to do the following: </li></ul><ul><ul><li>Create the initial chart that you want to use, using SAS/GRAPH software. This chart will become the primary chart in your linked series of graphs. </li></ul></ul><ul><ul><li>Create a variable to hold HREF addresses for the linked HTML files. </li></ul></ul><ul><ul><li>Define values for the new variable. </li></ul></ul><ul><ul><li>Set ODS output to HTML. </li></ul></ul><ul><ul><li>Attach links to the primary chart. </li></ul></ul><ul><ul><li>Create the secondary, linked charts and tables. </li></ul></ul>11/13/09 SAS Techies 2009
    21. 21. 11/13/09 SAS Techies 2009 <ul><ul><li>data work.saletrnd; </li></ul></ul><ul><ul><li>set finance.prdsal2; </li></ul></ul><ul><ul><li>/* create variables to hold HREF address strings */ </li></ul></ul><ul><ul><li>length PriDrill $ 40 SecDrill $ 40 ; </li></ul></ul><ul><ul><li>/* define the HTML links for the primary chart */ </li></ul></ul><ul><ul><li>if year= 1995 then pridrill='HREF=&quot;sales95.html&quot;'; </li></ul></ul><ul><ul><li>if year= 1996 then pridrill='HREF=&quot;sales96.html&quot;'; </li></ul></ul><ul><ul><li>if quarter= 1 then secdrill='HREF=&quot;#salesq1&quot;'; </li></ul></ul><ul><ul><li>if quarter= 2 then secdrill='HREF=&quot;#salesq2&quot;'; </li></ul></ul><ul><ul><li>if quarter= 3 then secdrill='HREF=&quot;#salesq3&quot;'; </li></ul></ul><ul><ul><li>if quarter= 4 then secdrill='HREF=&quot;#salesq4&quot;'; </li></ul></ul>
    22. 22. <ul><li>format actual dollar10.0; </li></ul><ul><li>run ; </li></ul><ul><li>ods listing close; </li></ul><ul><li>ods html path='c:datasales eports' </li></ul><ul><li>body='totalsales.html'; </li></ul><ul><li>goptions device=gif xpixels= 480 ypixels= 360 ; </li></ul><ul><li>/* title of the primary chart */ </li></ul><ul><li>title 'Total Sales by Year'; </li></ul><ul><li>/* create a bar chart of sales by year... */ </li></ul><ul><li>/* assign the HTML links held by PriDrill */ </li></ul><ul><li>proc gchart data=work.saletrnd; </li></ul><ul><li>vbar year / subgroup=prodtype discrete </li></ul><ul><li>sumvar=actual html=pridrill; </li></ul><ul><li>run ; </li></ul><ul><li>/* specify the HTML file name of the secondary chart... */ </li></ul><ul><li>/* set the title and create a bar chart where YEAR=1995 */ </li></ul><ul><li>ods html body='sales95.html'; </li></ul><ul><li>title 'Sales for 1995 by Quarter'; </li></ul>11/13/09 SAS Techies 2009
    23. 23. <ul><li>proc gchart data=work.saletrnd; </li></ul><ul><li>vbar quarter / sumvar=actual subgroup=product discrete </li></ul><ul><li>html=secdrill; </li></ul><ul><li>where year= 1995 ; </li></ul><ul><li>run ; </li></ul><ul><li>/* specify the HTML file name of the secondary chart... */ </li></ul><ul><li>/* set the title and create a bar chart where YEAR=1996 */ </li></ul><ul><li>ods html body='sales96.html'; </li></ul><ul><li>title 'Sales for 1996 by Quarter'; </li></ul><ul><li>proc gchart data=work.saletrnd; </li></ul><ul><li>vbar quarter / sumvar=actual subgroup=product discrete </li></ul><ul><li>html=secdrill; </li></ul><ul><li>where year= 1996 ; </li></ul><ul><li>run ; </li></ul><ul><li> quit ; </li></ul><ul><li>proc gchart data=work.saletrnd; </li></ul><ul><li>vbar quarter / sumvar=actual subgroup=product discrete </li></ul><ul><li>html=secdrill; </li></ul><ul><li>where year= 1995 ; </li></ul><ul><li>run ; </li></ul><ul><li>/* specify the HTML file name of the secondary chart... */ </li></ul><ul><li>/* set the title and create a bar chart where YEAR=1996 */ </li></ul><ul><li>ods html body='sales96.html'; </li></ul><ul><li>title 'Sales for 1996 by Quarter'; </li></ul><ul><li>proc gchart data=work.saletrnd; </li></ul><ul><li>vbar quarter / sumvar=actual subgroup=product discrete </li></ul><ul><li>html=secdrill; </li></ul><ul><li>where year= 1996 ; </li></ul><ul><li>run ; </li></ul><ul><li> quit ; </li></ul><ul><li>ods html close; </li></ul><ul><li>ods listing; </li></ul>11/13/09 SAS Techies 2009
    24. 24. <ul><li>/* create a named anchor in the current HTML page...set a */ </li></ul><ul><li>/* title and create a table where YEAR=1995 & QUARTER=1-4 */ </li></ul><ul><li>ods html anchor='salesq1'; </li></ul><ul><li>title '1st Quarter 1995 Sales by Country'; </li></ul><ul><li>proc tabulate data=work.saletrnd </li></ul><ul><li>format=dollar10.0; </li></ul><ul><li>class country product; </li></ul><ul><li>var actual; </li></ul><ul><li>table (country all)*(product all), sum*actual; </li></ul><ul><li>where year= 1995 and quarter= 1 ; </li></ul><ul><li>run ; </li></ul><ul><li>ods html close; </li></ul><ul><li>ods listing; </li></ul><ul><li>ods html anchor='salesq2'; </li></ul><ul><li>title '2nd Quarter 1998 Sales by Country'; </li></ul><ul><li>proc tabulate data=work.saletrnd </li></ul><ul><li>format=dollar10.0; </li></ul><ul><li>class country product; </li></ul><ul><li>var actual; </li></ul><ul><li>table (country all)*(product all), sum*actual; </li></ul><ul><li>where year= 1998 and quarter= 2 ; </li></ul><ul><li>run ; </li></ul><ul><li>ods html close; </li></ul><ul><li>ods listing; </li></ul>11/13/09 SAS Techies 2009

    ×