Sunteți pe pagina 1din 2

ODSTipSheet ODS Tip Sheet ODS Tip Sheet ODS Tip Sheet ODS Tip Sheet

Output Destination Output Destination Output Destination Output Destination


Basic Usage Basic Usage Basic Usage Basic Usage
ods output output-object-name=data-set-name; ods output output-object-name=data-set-name; ods output output-object-name=data-set-name; ods output output-object-name=data-set-name; procedure code procedure code procedure code procedure code ods output close; ods output close; ods output close; ods output close;

ODS
Column forlogo, address, and trademark info Column forlogo, address, and trademark info Column logo, address, and trademark info Column forforlogo,address,and trademark info

Example Example Example Example


Open several ODS destinations; Open several ODS destinations; **** Open several ODS destinations; Open several ODS destinations; ods html frame="report.html" ods html frame="report.html" ods html frame="report.html" ods html frame="report.html" file="reportb.html" file="reportb.html" file="reportb.html" file="reportb.html" contents="reportc.html" contents="reportc.html" contents="reportc.html" contents="reportc.html" style=styles.analysis; style=styles.analysis; style=styles.analysis; style=styles.analysis; ods pdf file="report.pdf" notoc; ods pdf file="report.pdf" notoc; ods pdf file="report.pdf" notoc; ods pdf file="report.pdf" notoc; ods rtf file="report.rtf" bodytitle; ods rtf file="report.rtf" bodytitle; ods rtf file="report.rtf" bodytitle; ods rtf file="report.rtf" bodytitle; ods tagsets.excelxp file="report.xls"; ods tagsets.excelxp file="report.xls"; ods tagsets.excelxp file="report.xls"; ods tagsets.excelxp file="report.xls"; ods output variables=work.vardata; ods output variables=work.vardata; ods output variables=work.vardata; ods output variables=work.vardata; Select only the "variables" table; Select only the "variables" table; **** Select only the "variables" table; Select only the "variables" table; ods select variables; ods select variables; ods select variables; ods select variables; Turn off proc titles; Turn off proc titles; **** Turn off proc titles; Turn off proc titles; ods noproctitle; ods noproctitle; ods noproctitle; ods noproctitle; Run the Contents Procedure; Run the Contents Procedure; **** Run the Contents Procedure; Run the Contents Procedure; proc contents data=sashelp.class; run; proc contents data=sashelp.class; run; proc contents data=sashelp.class; run; contents data=sashelp.class; run; proc Close all ODS destinations; Close all ODS destinations; **** Close all ODS destinations; Close all ODS destinations; ods _all_ close; ods _all_ close; ods _all_ close; ods _all_ close; Re-open the listing destination; Re-open the listing destination; **** Re-open the listing destination; Re-open the listing destination; ods listing; ods listing; ods listing; ods listing;

Use odstrace on;on; determine theoutput object Use odstrace on;totodetermine theoutput object Use trace determine output object Use odsodstraceon;to todeterminethetheoutputobject names. names. names. names.

Customizing Reports Customizing Reports Customizing Reports Customizing Reports


ods proclabel text; ods proclabel text; ods proclabel text; ods proclabel text; Specifies text touseuse place ofthetheprocedurelabel Specifies text touseininplace oftheprocedure label Specifies text place procedure label Specifies text to tousein inplaceofoftheprocedure label inthethetableofcontents. inthetable ofcontents. table contents. in inthetable ofofcontents. ods proctitle; orods noproctitle; ods proctitle; orods noproctitle; ods proctitle; ods noproctitle; ods proctitle; ororodsnoproctitle; Specifies whether ornotnottheproceduretitle should Specifies whether ornottheprocedure title should Specifies whether procedure title should Specifies whether orornotthetheproceduretitleshould beprinted. beprinted. beprinted. printed. be ods select selection(s); ods select selection(s); ods select selection(s); ods select selection(s); ods exclude selections(s); ods exclude selections(s); ods exclude selections(s); ods exclude selections(s); Specifiesthetheoutputobjectsto toshowororexcludefrom Specifiesthe outputobjects toshow orexclude from Specifies output objects show exclude from Specifies the outputobjects toshow orexclude from thereport, respectively. thereport, respectively. report, respectively. thethereport, respectively. ods show; ods show; ods show; ods show; Displayscurrent select and exclude lists. Displayscurrent select and exclude lists. Displays current select and exclude lists. Displays current select and exclude lists. ods trace on; ods trace on; ods trace ods trace on;on; Displaysinformation about output objects asasthey Displaysinformation about output objects asthey Displays information about output objects they Displays information about output objects asthey arecreated. This information includes thethenameofof arecreated. This information includes thename ofof created. This information includes name arearecreated. This information includes thename theobject, thethenameofthethetemplate,labels, paths, theobject, thename ofthetemplate, labels, paths, object, name template, labels, paths, thetheobject,thename ofofthetemplate, labels, paths, and label paths. and label paths. and label paths. and label paths.

ODS: ODS: ODS: ODS: Output Delivery Output Delivery Output Delivery Output Delivery System System System System Tip Sheet Tip Sheet Tip Sheet Tip Sheet
This tipsheet places frequently used This tipsheet places frequently used This sheet places frequently used This tip tipsheetplacesfrequently used informationin inoneplace, on ononesheetofof information inone place, onone sheet information one place, one sheet information inone place, onone sheet ofof paper, sosoyoudont have tosearch through the paper, you dont have tosearch through the paper, you dont have search through paper, sosoyoudont have totosearchthrough thethe online documentation. Italso gives you online documentation. Italso gives you online documentation. also gives you online documentation. It Italsogives you something totake home, type in,and try. something totake home, type in,and try. something take home, type and try. something tototakehome, type in, in,andtry. ODS allows you toformat your reports inin ODS allows you toformat your reports ODS allows you format your reports ODS allows you totoformatyour reports in in various formats such asasHTML,PDF, RTF, various formats such HTML, PDF, RTF, various formats such HTML, PDF, RTF, various formats such asasHTML,PDF, RTF, Microsoft Excel, and many others. Itenables Microsoft Excel, and many others. Itenables Microsoft Excel, and many others. enables Microsoft Excel, and many others. It Itenables you tocustomize your reports byselecting only you tocustomize your reports byselecting only you customize your reports selecting only you totocustomizeyour reports by byselectingonly theresults you want totosee.It Itevenlets you the results you want tosee. Iteven lets you the results you want see. even lets you the results you want tosee. Iteven lets you apply styles toyour reports including many apply styles toyour reports including many apply styles your reports including many apply styles totoyourreports including many supplied bySAS those that you create. This those that you create. This supplied bySAS ororthose that you create. This supplied SAS supplied by bySAS ororthosethat you create. This tipsheet presents themost common tipsheet presents themost common sheet presents most common tip tipsheetpresentsthethemostcommon statements and options inODS. statements and options inODS. statements and options ODS. statements and options in inODS.

QuickTime and a a a QuickTime and QuickTime and TIFF (LZW) decompressor TIFF (LZW) decompressor TIFF (LZW) decompressor areare neededsee thisthis picture. needed to see this picture. are needed toto see picture.

Locating Style Definitions Locating Style Definitions Locating Style Definitions Locating Style Definitions
odstemplates odstemplates odstemplates odstemplates Enteringodstemplates in inthecommand barbar Enteringodstemplates inthethecommandbar Entering odstemplates command Entering odstemplates inthecommand bar opensthetheTemplateBrowser.The styles supplied byby openstheTemplate Browser. The styles supplied by openstheTemplate Browser. The styles supplied by Template Browser. The styles supplied opens SAS arein thetheSASHELP.TMPLMST/Stylesfolder. SAS areinintheSASHELP.TMPLMST/Styles folder. SAS SASHELP.TMPLMST/Styles folder. SAS areareintheSASHELP.TMPLMST/Styles folder. proc template; liststyles; run; proc template; liststyles; run; proc template; styles; run; proc template; listliststyles;run; ListsthetheSAS-suppliedstylesto tothelog. Lists theSAS-supplied styles tothelog. Lists SAS-supplied styles log. Lists theSAS-supplied styles tothethelog.

Advanced Techniques Advanced Techniques Advanced Techniques Advanced Techniques


Formore information ononadvancedtechniques such Formore information advanced techniques such more information advanced techniques such ForFormoreinformationononadvancedtechniques such asthetheDOCUMENTdestinationwhich allows astheDOCUMENT destination which allows DOCUMENT destination which allows asastheDOCUMENT destination which allows extensive manipulation ofreports, orPROC extensive manipulation ofreports, orPROC extensive manipulation reports, PROC extensive manipulation ofofreports,ororPROC TEMPLATEwhich allows you to tomodifystyles asas TEMPLATEwhich allows you tomodify styles asas TEMPLATE which allows you modify styles TEMPLATE which allows you tomodify styles wellasascreatetable templates orormodifytable wellascreate table templates ormodify table well create table templates modify table well ascreate table templates ormodify table templatesused bybySASprocedures, seesee templatesused bySAS procedures, see templates used SAS procedures, templates used bySAS procedures, see http://support.sas.com/v9doc. http://support.sas.com/v9doc. http://support.sas.com/v9doc. http://support.sas.com/v9doc.

SAS Institute Inc. World Headquarters +1 919 677 8000 www.sas.com/offices For complete information, refer

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. Other brand and product names are trademarks of their respective companies. Copyright 2008, SAS Institute Inc. All rights reserved. 479398_01.08

For complete information, refertothe ForForcomplete information, refertothethe complete information, refer to tothe Base SAS 9.2documentation at at Base SAS 9.2documentation Base SAS documentation Base SAS 9.29.2documentationat at http://support.sas.com/v9doc http://support.sas.com/v9doc http://support.sas.com/v9doc http://support.sas.com/v9doc

ODS Tip Sheet ODS Tip Sheet ODSTipSheet


Common Destinations Common Destinations Common Destinations
Destination isis aterm for the ODS driver that Destination isa a term for the ODS driver that Destination term for the ODS driver that generates aaspecific output format. generates a specific output format. generates specific output format. Destination Name Description Destination Name Description Destination Name Description Listing Listing Listing Plain text Plain text Plain text HTML HTML HTML Primary format used on the Primary format used on the Primary format used on the World Wide Web (WWW) World Wide Web (WWW) World Wide Web (WWW) XML XML XML Plain text data interchange Plain text data interchange Plain text data interchange format format format PDF PDF PDF Works well for printing as Works well for printing as Works well for printing as well as on-screen viewing well as on-screen viewing well as on-screen viewing Postscript Postscript Postscript Works well for printing Works well for printing Works well for printing RTF RTF RTF Used by most word Used by most word Used by most word processors processors processors Tagsets.ExcelXP Tagsets.ExcelXP Tagsets.ExcelXP Share SAS data with Share SAS data with Share SAS data with Microsoft Excel Microsoft Excel Microsoft Excel Output Output Output Creates SAS data sets from Creates SAS data sets from Creates SAS data sets from ODS tables ODS tables ODS tables

HTML Destination HTML Destination HTML Destination


Basic Usage Basic Usage Basic Usage
ods html <option(s)>; ods html <option(s)>; ods html <option(s)>; procedure code procedure code procedure code ods html close; ods html close; ods html close;

PDF Destination PDF Destination PDF Destination


Basic Usage Basic Usage Basic Usage
ods pdf <option(s)>; ods pdf <option(s)>; ods pdf <option(s)>; procedure code procedure code procedure code ods pdf close; ods pdf close; ods pdf close;

RTF Destination RTF Destination RTF Destination


Basic Usage Basic Usage Basic Usage
ods rtf <option(s)>; ods rtf <option(s)>; ods rtf <option(s)>; procedure code procedure code procedure code ods rtf close; ods rtf close; ods rtf close;

File Options File Options File Options


file=filename or body=filename file=filename or body=filename file=filename or body=filename Specifies the name of the file that will contain the Specifies the name of the file that will contain the Specifies the name of the file that will contain the output tables. output tables. output tables. contents=filename contents=filename contents=filename Specifies the name of the file that will contain aa Specifies the name of the file that will contain a Specifies the name of the file that will contain table of contents for the output. table of contents for the output. table of contents for the output. frame=filename frame=filename frame=filename Specifies the name of the file that includes the body Specifies the name of the file that includes the body Specifies the name of the file that includes the body file and table of contents into aaset of scrollable file and table of contents into a set of scrollable file and table of contents into set of scrollable frames. frames. frames. stylesheet=filename stylesheet=filename stylesheet=filename Specifies an external filename for styles. Specifies an external filename for styles. Specifies an external filename for styles. The following file sub-options can be specified in The following file sub-options can be specified in The following file sub-options can be specified in parentheses following each of the above options. parentheses following each of the above options. parentheses following each of the above options. no_top_matter no_top_matter no_top_matter no_bottom_matter no_bottom_matter no_bottom_matter Specifies that no beginning or ending markup, Specifies that no beginning or ending markup, Specifies that no beginning or ending markup, respectively, should be inserted into the output file. respectively, should be inserted into the output file. respectively, should be inserted into the output file. url=URL url=URL url=URL Specifies aaURL to be used in place of the filename Specifies a URL to be used in place of the filename Specifies URL to be used in place of the filename in links to the file. in links to the file. in links to the file.

File Options File Options File Options


file=filename file=filename file=filename Specifies the name of the file that will contain the Specifies the name of the file that will contain the Specifies the name of the file that will contain the output tables. output tables. output tables.

File Options File Options File Options


file=filename file=filename file=filename Specifies the name of the file that will contain the Specifies the name of the file that will contain the Specifies the name of the file that will contain the output tables. output tables. output tables.

Document Metadata Options Document Metadata Options Document Metadata Options


author=text author=text author=text keywords=text keywords=text keywords=text subject=text subject=text subject=text title=text title=text title=text Specifies the author, keywords, subject, and title in Specifies the author, keywords, subject, and title in Specifies the author, keywords, subject, and title in the metadata of the PDF document. the metadata of the PDF document. the metadata of the PDF document.

Document Metadata Options Document Metadata Options Document Metadata Options


author=text author=text author=text operator=text operator=text operator=text title=text title=text title=text Specifies the author, operator, and title in the Specifies the author, operator, and title in the Specifies the author, operator, and title in the metadata of the RTF document. metadata of the RTF document. metadata of the RTF document.

Opening and Closing Destinations Opening and Closing Destinations Opening and Closing Destinations
ods destination-name <option(s)>; ods destination-name <option(s)>; ods destination-name <option(s)>; Opens the ODS destination, destination-name, with Opens the ODS destination, destination-name, with Opens the ODS destination, destination-name, with options, option(s). options, option(s). options, option(s). ods destination-name close; ods destination-name close; ods destination-name close; Closes the ODS destination, destination-name. Closes the ODS destination, destination-name. Closes the ODS destination, destination-name. ods _all_ close; ods _all_ close; ods _all_ close; Closes all ODS destinations (including Listing). Closes all ODS destinations (including Listing). Closes all ODS destinations (including Listing).

Other Commonly Used Options Other Commonly Used Options Other Commonly Used Options
columns=n columns=n columns=n Specifies the number of columns on each page. Specifies the number of columns on each page. Specifies the number of columns on each page. compress=n compress=n compress=n Specifies the level of compression. Specifies the level of compression. Specifies the level of compression. notoc notoc notoc Specifies that the table of contents bookmarks Specifies that the table of contents bookmarks Specifies that the table of contents bookmarks should not be generated. should not be generated. should not be generated. startpage=yes | |no | |now startpage=yes | no | now startpage=yes no now Controls page breaks. Controls page breaks. Controls page breaks. style=style-definition style=style-definition style=style-definition Specifies the style definition to use. Specifies the style definition to use. Specifies the style definition to use. uniform uniform uniform Specifies that multiple page tables should retain Specifies that multiple page tables should retain Specifies that multiple page tables should retain their width across pages. their width across pages. their width across pages.

Other Commonly Used Options Other Commonly Used Options Other Commonly Used Options
bodytitle bodytitle bodytitle Specifies that the titles and footnotes should appear Specifies that the titles and footnotes should appear Specifies that the titles and footnotes should appear in the body of the report, not as RTF instructions. in the body of the report, not as RTF instructions. in the body of the report, not as RTF instructions. columns=n columns=n columns=n Specifies the number of columns on each page. Specifies the number of columns on each page. Specifies the number of columns on each page. sasdate sasdate sasdate Specifies that the time and date that the SAS Specifies that the time and date that the SAS Specifies that the time and date that the SAS program was submitted should be written to the program was submitted should be written to the program was submitted should be written to the RTF, instead of the time that the file was opened. RTF, instead of the time that the file was opened. RTF, instead of the time that the file was opened. startpage=yes | |no | |now startpage=yes | no | now startpage=yes no now Controls page breaks. Controls page breaks. Controls page breaks. style=style-definition style=style-definition style=style-definition Specifies the style definition to use. Specifies the style definition to use. Specifies the style definition to use.

Basic ODS Usage Basic ODS Usage Basic ODS Usage


ods destination-name; ods destination-name; ods destination-name; procedure code procedure code procedure code ods destination-name close; ods destination-name close; ods destination-name close;

Other Commonly Used Option Other Commonly Used Option Other Commonly Used Option
style=style-definition style=style-definition style=style-definition Specifies the style definition to use. Specifies the style definition to use. Specifies the style definition to use.

S-ar putea să vă placă și