Presentation is loading. Please wait.

Presentation is loading. Please wait.

©Dofasco Inc., 2004 All rights reserved 1 Using the Output Delivery System October 22, 2004 Presentation to: The Toronto Area SAS Society.

Similar presentations


Presentation on theme: "©Dofasco Inc., 2004 All rights reserved 1 Using the Output Delivery System October 22, 2004 Presentation to: The Toronto Area SAS Society."— Presentation transcript:

1 ©Dofasco Inc., 2004 All rights reserved 1 Using the Output Delivery System October 22, 2004 Presentation to: The Toronto Area SAS Society

2 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 2 Agenda Introduction Introduction Book Review Book Review CD Book Review CD Book Review Some examples using ODS Some examples using ODS Summary Summary

3 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 3 Introduction Book Review: Quick Results with the Output Delivery System, Sunil Gupta, © 2003, SAS Institute Inc. Book Review: Quick Results with the Output Delivery System, Sunil Gupta, © 2003, SAS Institute Inc. CD Book Review: Instant ODS, Bernadette Johnson, © 2003, SAS Institute Inc. CD Book Review: Instant ODS, Bernadette Johnson, © 2003, SAS Institute Inc. Examples: Using ODS in some practical situations. Examples: Using ODS in some practical situations.

4 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 4 Quick Results with the Output Delivery System Beginner Level Beginner Level About 100 pages (just the right length) About 100 pages (just the right length) Well written Well written Clear Examples Clear Examples Logical Progression Logical Progression

5 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 5 Basic ODS Syntax ODS TRACE on / ; ODS destination ; ODS OUTPUT output-object-SAS-Data-Set-name ; ODS SELECT list ; ----- your program ------ ODS CLOSE ; ODS TRACE off;

6 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 6 Destinations What format do you want your report in? What format do you want your report in? HTML – web pages HTML – web pages PDF – acrobat reader PDF – acrobat reader RTF- document format RTF- document format Printer formats- PRINTER, PS, PCL Printer formats- PRINTER, PS, PCL LISTING- traditional SAS output LISTING- traditional SAS output MAIL- email * not in book MAIL- email * not in book ODS destination ; ODS destination ; (Remember to match the extension to the destination)

7 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 7 Objects Blocks of output created by SAS procedures. Blocks of output created by SAS procedures. Univariate: Univariate: Moments Moments BasicMeasures BasicMeasures TestsForLocation TestsForLocation Quantiles Quantiles ExtremeObs ExtremeObs ODS SELECT/EXCLUDE list ; ODS SELECT/EXCLUDE list ;

8 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 8 Inserting Graphs filename odsout 'h:\Sas'; filename odsout 'h:\Sas'; filename grafout 'h:\Sas'; filename grafout 'h:\Sas'; goptions reset=all device=html; goptions reset=all device=html; ODS HTML path=odsout gpath=grafout body="Test.htm"; ODS HTML path=odsout gpath=grafout body="Test.htm"; options ps=55 ls=80 nodate nonumber; options ps=55 ls=80 nodate nonumber; title 'Steel Export Levels'; title 'Steel Export Levels'; axis1 label=(a=-90 'Millions of Tons Exported'); axis1 label=(a=-90 'Millions of Tons Exported'); symbol1 v=none i=join l=1 w=3; symbol1 v=none i=join l=1 w=3; proc gchart data=sashelp.steel; proc gchart data=sashelp.steel; vbar date/discrete freq=steel raxis=axis1; vbar date/discrete freq=steel raxis=axis1; run; run; proc gplot data=sashelp.steel; proc gplot data=sashelp.steel; plot steel*date/ vaxis=axis1; plot steel*date/ vaxis=axis1; run; run; ODS HTML Close; ODS HTML Close; run; run; Note: We are using a SAS Sample Data Set found in SASHELP

9 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 9 Inserting Graphs BASE HTML FILE INDEX FILE VARIOUS GRAPHS

10 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 10 Viewing HTML Output

11 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 11 Instant ODS- Using Styles 50 pre-packaged styles in HTML, PDF and RTF format. 50 pre-packaged styles in HTML, PDF and RTF format. Step 1: Check the system requirements Step 1: Check the system requirements Step 2: Save the ODS library to a hard disk Step 2: Save the ODS library to a hard disk Step 3: Select a style Step 3: Select a style Step 4: Insert your code into the basic ODS code provided Step 4: Insert your code into the basic ODS code provided Step 5: Run program and enjoy results. Step 5: Run program and enjoy results.

12 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 12 Instant ODS- Using Styles Some notes: Some notes: Match the code to the style carefully Match the code to the style carefully When you use the code provided open in Notepad first (code_files folder on CD) and copy and paste into the editor When you use the code provided open in Notepad first (code_files folder on CD) and copy and paste into the editor Print the welcome.pdf file Print the welcome.pdf file The time savings is great for the price! The time savings is great for the price!

13 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 13 An Instant ODS Example Program: Program: ODS PATH (PREPEND) demo.ODS(READ); ODS PATH (PREPEND) demo.ODS(READ); GOPTIONS HSIZE=7 IN VSIZE=5IN; *size graphs 2.5in by 3.5in; GOPTIONS HSIZE=7 IN VSIZE=5IN; *size graphs 2.5in by 3.5in; ODS MARKUP ODS MARKUP TAGSET=web_graph_1 FRAME='h:\sas\demo\html-frame-tassdemo2.htm' TAGSET=web_graph_1 FRAME='h:\sas\demo\html-frame-tassdemo2.htm' BODY='h:\sas\demo\html-body-tassdemo2.htm' BODY='h:\sas\demo\html-body-tassdemo2.htm' CONTENTS='h:\sas\demo\html-table-contents-tassdemo2.htm' CONTENTS='h:\sas\demo\html-table-contents-tassdemo2.htm' GPATH='h:\sas\demo' (URL=NONE) ; GPATH='h:\sas\demo' (URL=NONE) ; goptions cback=cream; goptions cback=cream; title f=zapfb h=1.75 'Steel Exports in Millions of Tons'; title f=zapfb h=1.75 'Steel Exports in Millions of Tons'; symbol1 i=join l=1 w=4 v=none c=white; symbol1 i=join l=1 w=4 v=none c=white; axis1 label=(a=90 f=zapfb h=1.5 'Millions of Tons'); axis1 label=(a=90 f=zapfb h=1.5 'Millions of Tons'); axis2 label=(f=zapfb h=1.5 'Year' ); axis2 label=(f=zapfb h=1.5 'Year' ); proc gplot data=sashelp.steel; proc gplot data=sashelp.steel; plot steel*date/haxis=axis2 vaxis=axis1 cframe=cream; plot steel*date/haxis=axis2 vaxis=axis1 cframe=cream; run; run; ODS MARKUP CLOSE; ODS MARKUP CLOSE; Run; Run;

14 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 14 ODS Output

15 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 15 Do-it-yourself Example Step 1: Set up a new style template Step 1: Set up a new style template Program (Sets up a place to keep the style): Program (Sets up a place to keep the style): libname demo 'h:\sas\demo'; libname demo 'h:\sas\demo'; ods path demo.mytemp(update) sashelp.tmplmst(read); ods path demo.mytemp(update) sashelp.tmplmst(read); ODS PATH SHOW ; ODS PATH SHOW ; proc template; proc template; edit styles.default as styles.sc; edit styles.default as styles.sc; style data from cell /background=vligb; style data from cell /background=vligb; style header from headersandfooters background=vligb; style header from headersandfooters background=vligb;

16 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 16 Do-it-yourself Example Program cont’d (General Colors and Styles): Program cont’d (General Colors and Styles): style table from output / style table from output / background=black borderwidth=1 tagattr='align="left"'; background=black borderwidth=1 tagattr='align="left"'; style color_list / 'bgA' = ligb 'fgA2' = black style color_list / 'bgA' = ligb 'fgA2' = black 'fgA1'= black 'fga'= black; 'fgA1'= black 'fga'= black; style colors / style colors / 'contitlefg'=color_list('fgA2') 'contitlefg'=color_list('fgA2') 'confolderfg'=color_list('fgA2'); 'confolderfg'=color_list('fgA2'); style fonts / style fonts / 'headingFont' = ("Arial, Helvetica, Helv", 1, demi_bold) 'headingFont' = ("Arial, Helvetica, Helv", 1, demi_bold) 'docFont' = ("Arial, Helvetica, Helv",1,demi_bold) 'docFont' = ("Arial, Helvetica, Helv",1,demi_bold) 'titlefont' = ("Arial, Helvetica, Helv",1,bold); 'titlefont' = ("Arial, Helvetica, Helv",1,bold);

17 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 17 Do-it-yourself Example Program cont’d (Table of Contents): Program cont’d (Table of Contents): style contenttitle from indextitle /font=(arial,3,bold); style contenttitle from indextitle /font=(arial,3,bold); (Content Title) (Content Title) style contentproclabel from contentprocname /font=(arial,2); style contentproclabel from contentprocname /font=(arial,2); (Label replacing the procedure) (Label replacing the procedure) style contentprocname from indexprocname /font=(arial,2); style contentprocname from indexprocname /font=(arial,2); (The Procedure Name) (The Procedure Name) style Bycontentfolder from Bycontentfolder /font=(arial,2); style Bycontentfolder from Bycontentfolder /font=(arial,2); (The by-variable info) (The by-variable info) style contentitem from indexitem /font=(arial,2); style contentitem from indexitem /font=(arial,2); (The item is the list) (The item is the list)

18 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 18 Do-it-yourself Example Program cont’d (Table of Contents cont’d…): Program cont’d (Table of Contents cont’d…): style contentProcname from Indexprocname /bullet=none; style contentProcname from Indexprocname /bullet=none; style ByContentFolder from ContentFolder /Bullet = NONE style ByContentFolder from ContentFolder /Bullet = NONE ListEntryAnchor = yes ListEntryAnchor = yes PreHtml = _undef_ PreHtml = _undef_ PostHtml = _undef_; PostHtml = _undef_; Style ContentItem from IndexItem /Bullet = NONE Style ContentItem from IndexItem /Bullet = NONE ListEntryAnchor = yes ListEntryAnchor = yes PreHtml = _undef_ PreHtml = _undef_ PostHtml = _undef_ PostHtml = _undef_ pretext=" " pretext=" " posttext=" "; posttext=" ";

19 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 19 Do-it-yourself Example Program cont’d (Table of Contents cont’d…): Program cont’d (Table of Contents cont’d…): Style ContentTitle from IndexTitle / Style ContentTitle from IndexTitle / PRETEXT='MECHANICAL PROPERTIES BREAKDOWN FOR 2003- ALL TESTS'; PRETEXT='MECHANICAL PROPERTIES BREAKDOWN FOR 2003- ALL TESTS'; style contents from documents / style contents from documents / background=vligb; background=vligb; style table from output /outputwidth=10%; style table from output /outputwidth=10%; end; end; run; run;

20 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 20 Do-it-yourself Example The Log: The Log:

21 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 21 Do-it-yourself Example Using the style: Using the style: The program: The program: libname sasdata 'h:\sas\demo'; libname sasdata 'h:\sas\demo'; proc template; proc template; define style new; define style new; parent=styles.sc; parent=styles.sc; *Changing Title name of the table of contents; *Changing Title name of the table of contents; replace ContentTitle from IndexTitle / replace ContentTitle from IndexTitle / PRETEXT='2003 Summary-By Grade Group' PRETEXT='2003 Summary-By Grade Group' font=(arial,3,bold); font=(arial,3,bold); END; END; RUN; RUN;

22 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 22 Do-it-yourself Example The Program cont’d: The Program cont’d: options nocenter; options nocenter; filename odsout 'h:\sas\demo\'; filename odsout 'h:\sas\demo\'; ods listing close; ods listing close; ods html path=odsout ods html path=odsout contents="TassDemo_Contents.html contents="TassDemo_Contents.html frame="TassDemo_Frame.html" frame="TassDemo_Frame.html" body="TassDemo_Body.html“ newfile=output style=new; body="TassDemo_Body.html“ newfile=output style=new; ODS PROCLABEL 'BY GRADE GROUP'; ODS PROCLABEL 'BY GRADE GROUP'; options pageno=1 device=win; options pageno=1 device=win; title1 'MECHANICAL PROPERTIES 2003 - Jan to Dec' ; title1 'MECHANICAL PROPERTIES 2003 - Jan to Dec' ; TITLE2 ; TITLE2 ; FOOTNOTE1 'Note: Includes all test results'; FOOTNOTE1 'Note: Includes all test results';

23 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 23 Do-it-yourself Example The Program cont’d: The Program cont’d: proc tabulate data=demo.test2 contents=''; proc tabulate data=demo.test2 contents=''; class GradeGrp GradeNo StdCode DirectCd class GradeGrp GradeNo StdCode DirectCd DispCd TempNo TemperCd ThickRange; DispCd TempNo TemperCd ThickRange; var Yield TensileA ElongB Mech1020 ; var Yield TensileA ElongB Mech1020 ; keylabel mean='Avg'; keylabel mean='Avg'; label DispCd= 'Dispo'; label DispCd= 'Dispo'; table GradeGrp=“", all GradeNo='GRADE'* ThickRange='THICKNESS'* table GradeGrp=“", all GradeNo='GRADE'* ThickRange='THICKNESS'* TempNo='TEMP'* TemperCD='CW'* DirectCd='DIR'* TempNo='TEMP'* TemperCD='CW'* DirectCd='DIR'* StdCode='STDC'* (all DispCd), StdCode='STDC'* (all DispCd), Yield='YIELD'*(n*f=4.0 mean*f=5.1 std*f=4.1 min*f=5.1 max*f=5.1) Yield='YIELD'*(n*f=4.0 mean*f=5.1 std*f=4.1 min*f=5.1 max*f=5.1) TensileA='TENSILE'*(mean*f=5.1 std*f=4.1 min*f=5.1 max*f=5.1) TensileA='TENSILE'*(mean*f=5.1 std*f=4.1 min*f=5.1 max*f=5.1) ElongB='ELONGATION'*(mean*f=5.1 std*f=4.1 min*f=5.1 max*f=5.1) ElongB='ELONGATION'*(mean*f=5.1 std*f=4.1 min*f=5.1 max*f=5.1) Mech1020='MECHVAL'*(mean*f=5.3 std*f=5.3 min*f=5.3 max*f=5.3) Mech1020='MECHVAL'*(mean*f=5.3 std*f=5.3 min*f=5.3 max*f=5.3) /condense misstext='-' contents=‘ ' ; /condense misstext='-' contents=‘ ' ; run; run; ods html close; ods html close; ods listing; ods listing;

24 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 24 Do-it-yourself Example The Output: The Output:

25 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 25 Do-it-yourself Example

26 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 26 Instant ODS Example The Output using an ODS template: The Output using an ODS template:

27 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 27 Instant ODS Example

28 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 28 Summary Quick Results using the Output Delivery System Quick Results using the Output Delivery System Instant ODS Instant ODS Do-it-yourself Example Do-it-yourself Example Instant ODS Example Instant ODS Example

29 October 22, 2004 © Dofasco Inc. 2004 All rights reserved 29 Questions? Contact information: Lesley Harschnitz- lesley_harschnitz@dofasco.calesley_harschnitz@dofasco.ca Sandra Cunningham- sandra_cunningham@dofasco.casandra_cunningham@dofasco.ca


Download ppt "©Dofasco Inc., 2004 All rights reserved 1 Using the Output Delivery System October 22, 2004 Presentation to: The Toronto Area SAS Society."

Similar presentations


Ads by Google