资源预览内容
第1页 / 共23页
第2页 / 共23页
第3页 / 共23页
第4页 / 共23页
第5页 / 共23页
第6页 / 共23页
第7页 / 共23页
第8页 / 共23页
第9页 / 共23页
第10页 / 共23页
亲,该文档总共23页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
Chapter 5: Enhancing Your Output with ODS “Some men see things as they are and say, Why. I dream things that never were and say, Why not.“ Robert F. Kennedy From Respectfully Quoted: A Dictionary of Quotations from the Library of Congress, edited by Suzy Platt, copyright 1992 by Library of Congress. Based on George Bernard Shaw, Back to Methuselah, act 1, 1949. 5.1 Concepts of the Output Delivery System You might think that procedures produce output. They dont. Technically, procedures produce only data. Then they send that data to the Output Delivery System (ODS) which determines where the output should go and what it should look like when it gets there. That means the question to ask yourself is not whether you want to use ODSyou always use ODS. The question is whether to accept default output or choose something else. ODS is like a busy airport. Passengers arrive by car and bus. Once at the airport, passengers check baggage, pass security, eventually board a plane, and fly out to their destinations. In ODS, data are like passengers arriving from various procedures. ODS processes each set of data and sends it off to its proper destination. In fact, different types of ODS output are called destinations. What your data look like when they get to their destination is determined by templates. A template is a set of instructions telling ODS how to format your data. These two conceptsdestinations and templates are fundamental to understanding what you can do with ODS. Destinations Starting with SAS 9.3 if you dont specify a destination, your output will be sent, by default, to HTML when you use the SAS windowing environment in Microsoft Windows or UNIX. With SAS 9.2 and earlier, the default destination was LISTING. LISTING is still the default for programs run in batch or in other operating environments. Here are the major destinations: Most of these destinations are designed to create output for viewing on a screen or for printing. The LISTING destination is what appears in the Output window in the SAS windowing environment, or in the listing or output file if you use batch mode. The MARKUP destination is a general purpose tool for creating output in formats defined by tagsets. This includes XML (eXtensible Markup Language), EXCELXP, LaTeX, CSV (comma-separated values), and many other formats where data can be thought of as separated by tags. The OUTPUT destination creates SAS data sets. The DOCUMENT destination, on the other hand, allows you to create a reusable output “document“ that you can re-render for any destination. So, if your boss decides he really wants that report in PDF, not RTF, you can replay the output document without having to rerun the entire SAS program that created the data. With an output document, you can also rearrange, duplicate, or delete tables to further customize your output. Style and Table Templates HTML Hypertext Markup Language LISTING text output PDF Portable Document Format PS PostScript PRINTER high-resolution printer output RTF Rich Text Format MARKUP markup languages including XML DOCUMENT output document OUTPUT SAS data set The Little SAS Book: A Primer, Fifth EditionSAS Institute, SAS Institute Inc. (c) 2012, Copying ProhibitedPage 2 / 24Templates tell ODS how to format and present your data. The two most common types of templates are table templates and style templates (also called table definitions and style definitions). A table template specifies the basic structure of your output (which variable will be in the first column?); while a style template specifies how the output will look (will the headers be blue or red?). ODS combines the data produced by a procedure with a table template and together they are called an output object. The output object is then combined with a style template and sent to a destination to create your final output. 1 You can create your own table and style templates using the TEMPLATE procedure. However, PROC TEMPLATEs syntax is rather arcane. Fortunately, there are other, easier, ways to control and modify output. The quickest and easiest way to change the look of your output is to use one of the many built-in style templates. To view a list of the style templates available on your system, submit the following PROC TEMPLATE statements: PROC TEMPLATE; LIST STYLES; RUN; A few of the built-in style templates are ANALYSIS D3D MINIMAL SASWEB BARRETTSBLUE HTMLBLUE PRINTER SANSPRINTER BRICK JOURNAL RTF STATISTICAL Notice that RTF and PRINTER are names of both destinations and styles. Some styles work better with certain destinations than with others. HTMLBLUE is the default style for HTML output, RTF is the default style for RTF output, and PRINTER is the default style for output sent to the PRINTER, PDF, and PS destinations. A few procedures, most notably PRINT, REPORT, and TABULATE, dont have ready-made table templates. Instead, the syntax for these proce
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号