Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance...

90
Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS Institute Inc.

Transcript of Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance...

Page 1: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

SAS Graphics on ODS v9.2 Performance Enhancing Steroids

Daniel O’ConnorSystems Developer, SAS Institute Inc.

Page 2: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Professional Athletes Accused of Abuse

Page 3: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

ODS Styles

Colors

Fonts

Overall appearance

Theme

Symbols

Line Patterns

Page 4: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

SAS 9.2 Graphs honor Styles

SAS 9.1 SAS 9.2

Page 5: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

SAS 9.2 Graphs honor Styles

title "Perceived Harmfulness of Steroids";

footnote "Source: 2005 Monitoring the Future Survey.";

goptions device=png hsize=3in vsize=3in border;

proc gchart;

axis1 label=none;

vbar year / width=12 outside=sum sumvar=response

discrete maxis=axis1 raxis=axis1;

;run;quit;

Page 6: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

GSTYLE Option

Options <GSTYLE | NOGSTYLE>

<GSTYLE = < ON | OFF>>;

Default: GSTYLE

Graphs will automatically honor theactive ODS Style for each outputdestination.

Page 7: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Default Styles

Output Destination Default StyleListing Listing (Graphics ONLY)HTML DefaultRTF RTfMeasured RTF RTF

PDF PrinterPostscript PrinterPCL MonochromePrinterPrinter Printer

Page 8: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Changing the Default Styles

Page 9: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

How do ODS Styles effect my output?

Page 10: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Overriding the Default Style

title "Perceived Harmfulness of Steroids";

footnote "Source: 2005 Monitoring the Future Survey.";

goptions device=png hsize=3in vsize=3in border;

ods listing style=< MonochromePrinter or Default > ;

proc gchart;axis1 label=none;vbar year / width=12 outside=sum sumvar=response discrete maxis=axis1 raxis=axis1;;run;quit;

Page 11: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Creating your own style

Page 12: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Creating your own style

proc template; define style Styles.SGFImage; parent=Styles.science;style GraphBackground "Graph background attributes" / backgroundimage = "pillsLighten4.jpg";end;run;

ods listing style=SGFImage;

Page 13: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Customizing your own style

Page 14: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Gradient Colors

style GraphBackground "Graph background attributes" / startcolor = cx4a495a endcolor = cx000000 gradient_direction = "YAxis";

style GraphData1 “Graph Data attributes” /startcolor=GraphColors("gcdata1") endcolor=cxd6deef gradient_direction="yaxis";

[ snip….]

style GraphData8 “Graph Data attributes” /startcolor=GraphColors("gcdata8") endcolor=cxf7dee7 gradient_direction="yaxis";

Page 15: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Free Type Font Engine

SAS TrueType Font Type Face Metric CompatibilityAlbany AMT sans-serif ArialThorndale AMT serif Times New RomanCumberland AMT fixed serif Courier NewSymbol MT Symbol SymbolMonotype Sorts Symbol Wingding

Page 16: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Graphic Devices

DPI

Default Sizes

Orientation

Catalog Grseg

Image Type

Page 17: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Default Graphic Devices

Output Destination Default DeviceListing Host Specific Display Device (

PC - WIN; UNIX - XCOLOR; MVS - Display Device)

HTML PNGRTF SASEMFMeasured RTF PNG

PDFSASPRTC (Color Output) *

Postscript SASPRTC (Color Output) *PCL SASPRTM (Monochrome Printer Host Specific Default Printer ** Does not support changing the Default Device in the SAS Registry.

Page 18: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Changing Graphic Devices

Options device=png

Goption device=png

Ods <destination> device=png

Page 19: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Valid Image Formats

Output Destination Default Device

ListingPNG, GIF, BMP, JPEG, PBM, PS, PDF, TIFF, EMF, EPS, DIB, PCL, PICT, WMF, XBM, XPM, SVG

HTML PNG, GIF, JPEG, SVG

RTF PNG, EMF, JPEG

Measured RTF PNG, EMF, JPEG

PDF PNG, PS, PDF, PCL, JPEG, GIF

Postscript PNG, PS, PDF, PCL, JPEG, GIF

PCL PNG, PS, PDF, PCL, JPEG, GIF

Printer PNG, PS, PDF, PCL, JPEG, GIF

Page 20: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Scalable Vector Graphics Device Driver

Page 21: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Scalable Vector Graphics Device Drivergoptions device=svg;

title "Perceived Harmfulness of Steroids";

footnote "Source: 2005 Monitoring the Future Survey.";

ods html file=“Slide20.html";

proc gchart; axis1 label=none;vbar year / width=12 outside=sum sumvar=response discrete maxis=axis1 raxis=axis1;run;quit;

ods html close;

Page 22: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

ODS Destination Interactions

Page 23: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

ODS Destination Interactionsods html file=”Slide22Sketch.html” style=Sketch;

ods pdf ” file=”Slide22Banker.pdf” style=Banker;

goptions hsize=3.25in vsize=3in border;proc gchart data=sashelp.class;vbar age;run; quit;

ods pdf close;

ods html close;

Page 24: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Graphic Catalog Entries

Page 25: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Altering the position and size of the graph

Hsize

Vsize

Horigin

Vorigin

Page 26: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Multiple Columns

RTF and PDF only

columns = <n>

Example:

Ods pdf file=“slide19.pdf” columns = 3;…

Start New Page

Page 27: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Managing Output with Multiple Columns

Page 28: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Managing Output with Multiple Columns

ods pdf file=“Slide26.pdf" columns=2;

title "Perceived Harmfulness of Steroids";footnote "Source: 2005 Monitoring the Future Survey.";axis1 label=none;proc gchart;vbar year / width=12 outside=sum sumvar=responsediscrete maxis=axis1 raxis=axis1;run;quit;proc gchart;vbar year / width=12 outside=sum sumvar=responsediscrete maxis=axis1 raxis=axis1;run;quit;

ods pdf close;

Page 29: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Managing Output with Multiple Rows

Page 30: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Managing Output with Startpage

STARTPAGE = < NEVER | NO | YES | NOW >

NEVER do not insert any page breaks

NO new page will only begin when thepage is full

YES Insert new pages on PROCboundaries, and when PROCspecifically requests one

NOW Immediately start a new page

Page 31: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Managing Output with Multiple Rowsods pdf file=“Slide28.pdf" Startpage=no;

goptions vsize=5in;

title "Perceived Harmfulness of Steroids";footnote "Source: 2005 Monitoring the Future Survey.";axis1 label=none;proc gchart;vbar year / width=12 outside=sum sumvar=responsediscrete maxis=axis1 raxis=axis1;run;quit;proc gchart;vbar year / width=12 outside=sum sumvar=responsediscrete maxis=axis1 raxis=axis1;run;quit;

ods pdf close;

Page 32: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Managing Output with Multiple Rows & Columns

Page 33: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Managing Output on a page

ods pdf file=“Slide30.pdf" startpage=no columns=2;

goptions vsize=5in border;

axis1 label=none;proc gchart;vbar year / width=12 outside=sum sumvar=responsediscrete maxis=axis1 raxis=axis1;run;quit;proc gchart;vbar year / width=12 outside=sum sumvar=responsediscrete maxis=axis1 raxis=axis1;run;quit;proc gchart;vbar year / width=12 outside=sum sumvar=responsediscrete maxis=axis1 raxis=axis1;run;quit;proc gchart;vbar year / width=12 outside=sum sumvar=responsediscrete maxis=axis1 raxis=axis1;run;quit;

ods pdf close;

Page 34: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Managing Output with Multiple Columns

Page 35: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Multiple Columns

Page 36: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Multiple Columns

Page 37: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Customizing Date/Timestamp and Page Number

Page 38: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Customizing Date/Timestamp and Page Number

proc template;define style Styles.Pageno;parent=Styles.Printer;class BodyDate /

vjust=Bottom just=Right;class Pageno /vjust=Bottom just=Center;end; run;

ods pdf file=“Slide32.pdf" startpage=no style=Pageno;[ same as previous graph code]

ods pdf close;

Page 39: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Managing your Output Width ODS LAYOUT

Absolute

Gridded

Page 40: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Managing your Output Width ODS Layout

Ods layout start <options> ;

Ods region < options > ;

Ods layout end ;

Page 41: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Reasons why you would use Absolute Layout

Cover Page

Static Data

Pre-printed Form

Single Page Only

Page 42: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Absolute Layout Title

Footnote

Layout

Region

Region

Ods layout start width=7in

height=10in;

Ods layout end;

Ods region x=2.5in y=3.5in width=3in height=2in;< sas code>

Ods region x=4in y=5.5in width=3in height=2in;< sas code>

Page 43: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

ODS Absolute Layout

Page 44: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

ODS Absolute Layoutods layout start width=7in height=10in;

ods region height=3in width=3in x=0in y=.5in;proc print data=sashelp.class(obs=5);run;

ods region height=3in width=3in x=5in y=.5in;ods pdf text='~{style [font_size=28pt]To the left is a PROC …}';

ods region height=3in width=3in x=0in y=3.5in;ods pdf text='~{style [font_size=28pt]To the right is a PROC …}';

ods region height=3in width=3in x=5in y=3.5in;proc sgplot data=sashelp.class; scatter x=height y=weight /group=age;run;

ods region height=3in width=3in x=0in y=8in;proc gchart data=sashelp.class; vbar age; run;quit;

ods region height=3in width=3in x=5in y=8in;ods pdf text='~{style [font_size=28pt]To the left is a PROC ...}';

ods layout end;

Page 45: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

ODS Absolute LayoutSyntax:

ODS LAYOUT START < X = < dimension> Y = < dimension> Width = < dimension > Height = < dimension > > ;

ODS REGION

< X = < dimension> Y = < dimension> Width = < dimension > Height = < dimension > > ;

ODS LAYOUT END;

Page 46: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Reasons why you would use Gridded Layout

Regions can be dynamically sized

Accommodate dynamic data

Ease of use (less syntax)

Alignment

Can span more than 1 page

Page 47: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Gridded Layout Tile

Footnote

Region

Region

Region

Region

Start New Page

Region

Ods layout start columns =2;

Ods layout end;

Ods region;< sas code>

Ods region;< sas code>

Ods region;< sas code>

Ods region;< sas code>

Ods region column_span=2;< sas code>

Page 48: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Gridded LayoutTile

Footnote

Region 1 Region 2

Tile

Footnote

Region 1 Region 2

Start New Page

Page 49: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Managing Output with ODS Gridded Layout

Page 50: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Managing Output with ODS Gridded Layout

ods layout start columns=2;

ods region width=4in;proc gchart;axis1 label=none;vbar year / width=12 outside=sum sumvar=responsediscrete maxis=axis1 raxis=axis1;run;quit;

ods region; proc print;run;

ods layout end;

Page 51: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

ODS Gridded LayoutSyntax:

ODS LAYOUT START < Width = < dimension > Height = < dimension >

Rows = < n > Row_heights = <dimension> Row_gutter = <dimension>

Columns = < n > Column_widths = <dimension> Column_gutter = <dimension> > ;

Page 52: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Gridded Layout Tile

Footnote

Region

Region

Region

Region

Region

COLUMN_GUTTER

ROW_GUTTER

COLUMN_WIDTHS

3in 4in

ROW_HEIGHT

2in

Page 53: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

ODS Gridded LayoutSyntax:

ODS REGION

< Width = < dimension > Height = < dimension >

Row_span = < n >

Row = <n>

Column_span = < n > Column = <n> > ;

Page 54: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Page 55: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Page 56: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Page 57: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Page 58: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

ODS Report Writing Interface

Page 59: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

ODS Report Writing Interface

Invoices

Form letters

Report is not rectangular in nature

Report is very data centric

Requires special conditional logic

Need to compute & display special summarization information

Need to add narrative information inside a table

Page 60: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

ODS Report Writing Interfacedata game;input HomeRank HomeTeam $4-15 HomeNickname $17-25 Homeone Hometwo Homeot VisitorRank VisitorTeam $38-49 VisitorNickname $52-60 Visitorone Visitortwo Visitorot Final;cards;7 TEXAS LONGHORNS 30 44 0 24 KANSAS STATE WILDCATS 30 35 0 4;run;

proc format;value game_status 1 = "1st“ 2 = "HALF“ 3 = "2nd“ 4 = "FINAL";run;

Page 61: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

ODS Report Writing Interface

data _null_; set game;

Dcl odsout obj();

obj.table_start(columns: 6 );

1 2 3 4 5 6

Page 62: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

ODS Report Writing Interface

obj.row_start();

obj.format_cell ( data: "Fred Bramlage Coliseum, Manhattan, KS", overrides: "font_size=10pt backgroundcolor=dark gray color=light gray", column_span: 6 );

obj.row_end();

1 2 3 4 5 6

Page 63: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

ODS Report Writing Interface

obj.format_cell(data: HomeRank, overrides: "backgroundcolor=dark gray color=light gray");

obj.format_cell(data: HomeTeam, overrides: "backgroundcolor=dark gray color=white");

obj.format_cell(data: Homeone+Hometwo+Homeot, column_span: 2);

obj.format_cell(data: Final, format: "game_status", row_span: 2, column_span: 2 );

1 2 3 4 5 6

Page 64: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

ODS Report Writing Interface

obj.format_cell(data: VisitorRank);

obj.format_cell(data: VisitorTeam );

obj.format_cell(data: Visitorone+Visitortwo+Visitort, overrides: “borderleftcolor = light gray bordertopcolor= light gray borderbottomcolor= light gray “);

1 2 3 4 5 6

Page 65: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

ODS Report Writing Interface

obj.format_cell( data: " ", column_span: 2, overrides: "backgroundcolor=light gray");

obj.format_cell( data: “1” );obj.format_cell( data: "2” );obj.format_cell( data: "OT“ ); obj.format_cell( data: "T“ );

1 2 3 4 5 6

Page 66: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

ODS Report Writing Interface

obj.format_cell(data: HomeNickname, column_span:2 );obj.format_cell(data: Homeone );obj.format_cell(data: Hometwo );obj.format_cell(data: Homeot );obj.format_cell(data: Homeone+Hometwo+Homeot );

1 2 3 4 5 6

Page 67: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

ODS Report Writing Interface

obj.format_cell(data: VisitorNickname, column_span:2 );obj.format_cell(data: Visitorone );obj.format_cell(data: Visitortwo );obj.format_cell(data: Visitorot );obj.format_cell(data: Visitorone+Visitortwo+Visitorot );

1 2 3 4 5 6

Page 68: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

ODS Report Writing Interface

obj.row_start();

obj.format_cell(data: "Attendance: N/A", column_span: 6, overrides: "vjust=bottom backgroundcolor=light gray");

obj.row_end();

obj.table_end();

1 2 3 4 5 6

Page 69: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

ODS Report Writing Interface

Page 70: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

ODS Report Writing Interface

Page 71: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

ODS Report Writing Interface

Page 72: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

ODS Graphics Architecture

Automatic Graphic Creation

Graph Template Language

New SAS/GRAPH Procedures

ODS Graphics Editor

Page 73: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Automatic Graphic Creation

ods graphics on;

/* bread and butter timeseries analysis graphics; */proc timeseries data=sashelp.workers out=_NULL_ plot = all print=all;id date interval=month;var electric masonry;run;

Page 74: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Automatic Graphic Creation

Page 75: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Automatic Graphic Creation

Page 76: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Graph Template Language (GTL)

Proc Template

Sophisticated Analytical Graphs

Page 77: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Automatic Graphic Creation

ods graphics on;ods trace on;

/* bread and butter timeseries analysis graphics; */proc timeseries data=sashelp.workers out=_NULL_ plot = histogramprint=all;id date interval=month;var electric masonry;run;

Page 78: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Automatic Graphic Creation

Page 79: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Automatic Graphic CreationBeginGraph;

EntryTitle TITLE;Layout Overlay / XAxisOpts=(label="Series" linearopts=( tickvalueformat=BEST12.)) yaxisopts=(label="Percent"); Histogram SERIES; DensityPlot SERIES /

LegendLabel="Normal" name="Normal"; DensityPlot SERIES / Kernel ()

LegendLabel="Kernel" name="Kernel“ lineattrs=GRAPHFIT2;DiscreteLegend "Normal" "Kernel" / across=1 location=inside autoalign=(topright topleft top);EndLayout;

EndGraph;

Page 80: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

SAS/GRAPH Procedures

SGPLOT

SGSCATTER

SGPANEL

SGRENDER

Page 81: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Heat Map (SGPLOT)

Page 82: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Heat Map

proc sgplot data=heatmap;scatter x=make y=type /group=groupmarkerattrs=(size=.28in symbol=squarefilled);run;

Page 83: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Paneled Plots (SGPanel)

Page 84: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Paneled Plots (SGPanel)

proc sgpanel data=cancer;panelby race sex / columns=5layout=latticenovarnameuniscale=column;hbar cause / response=incidence;colaxis grid label='Incidence per 100,000 People';rowaxis grid label=' '; run;

Page 85: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Stacked Band Plots (SGPLOT)

Page 86: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Butterfly Plots (SGPLOT)

Page 87: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Paneled Butterfly Plots (SGPANEL)

Page 88: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

More Paneled Plots

Page 89: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

ODS Statistical Graphics Editor

Page 90: Copyright © 2008, SAS Institute Inc. All rights reserved. SAS Graphics on ODS v9.2 Performance Enhancing Steroids Daniel O’Connor Systems Developer, SAS.

Copyright © 2008, SAS Institute Inc. All rights reserved.

Contact Information

Dan O’Connor

[email protected]

ODS Development Team

[email protected]