[SAS base] ODS output

Source: Internet
Author: User
Tags proc tabulate

I. Basic Nature of ODS

  • ODS output format: listing (default standard SAS output), HTML, RTF, prtnter, PS, PCL, PDF, output (SAS output date-set), markup, and document;
  • ODS contains the table template (specified output structure) and style template (specified appearance structure): first, the table template function generates data from procedure to form the output project, then, the style template is used to send to destination to form the final output. Of course, you can use proc template to create a custom table template (specify the output structure) and a style template (specify the appearance structure ):
    1 PROC TEMPLATE;2     LIST STYLES;3 RUN;
  • Style template that controls the appearance:
    1/* built-in style template: */2 Analysis 3 d3d 4 minimal 5 sasweb 6 barettsblue 7 default/* default style of HTML output */8 printer/* is both destination and style name, or the default style */9 sansprinter 10 brick 11 Journal 12 RTF/* of printer output is both the destination and style name, or the default style of RTF output */13 statstical14 15 remarks: in the print, report, and tabulate processes, the style = option can be used to control the output appearance, so you do not need to use a new style template.

    Ii. ODS output

1 General Form of ODS output: 2 ODS output-object = new-data-set; 3/* output-object: name, label, or path of the output to be saved; 4 New-data-set: name of the SAS dataset to be created */5 6 data giant; 7 infile 'C: \ myrawdata \ giant. dat '; 8 input name: $15. color $ days weight; 9 proc tabulate data = giant; 10 class color; 11 var days weight; 12 table color all, (days weight) * mean; 13 title; 14 ODS output table = tabout; 15 run;

3., ODS html

To generate an HTML file, you only need two statements: one to open the HTML file and the other to close the file:

1 * Create the HTML files and remove procedure name; 2 ods html file = 'C: \ myhtmlfiles \ marine.html '; 3/* General format: ----------body-filename.html ---------- options -- */4 ODS noproctitle;/* Delete the title in the output */5 Data Marine; 6/* omit the Data Reading step */7 proc means data = marine mean min max; 8 class family; 9 Title 'wahles and shark'; 10 run; 11 proc print data = marine; 12 run; 13 * close the HTML files; 14 ods html close; 15 16 [frequently used options] 17 1. contents = 'filename': Create a table of contents connected to the body file; 18 2. page = 'filename': create a link by page number and connect it to the table of contents; 19 3. frame = 'filename': Create a frame so that users can view both the body file and directory or page file; 20 4. style = style-Name: Specifies a specific style template. The default value is default.

Iv. ods rtf (which can be used for copying to a Word document)

* Create the RTF files; 2 ods rtf file = 'C: \ myhtmlfiles \ Marine. RTF 'bodytitle columns = 2; 3/* General Form: ---------- Body-filename.rtf ---------- options -- */4 ODS noproctitle;/* Delete the title in the output */(the middle part of the copper ods html process) 13 * close the RTF files; 14 ods rtf close; 15 16 [common options] 1. bodytitle: place titles and footnotes in the main part of the RTF file, instead of headers or footnotes in word; 2. columns = N: output by column. N indicates the number of columns. 3. sasdate: by default, the top date and practice output by RTF indicate the time when the word was last opened or printed. In addition, this command uses the current time by SAS. 3. startpage = value: Controls page breaks. The default value is yes, and breaks are inserted between Proc. If no, breaks are disabled. If yes, breaks are inserted at that moment. 4. style = style-Name: Specifies a specific style template. The default value is RTF.

 

Iv. ODS printer/PCL/pdf/PS

1 * Create the PDF files; 2 ods pdf file = 'C: \ myhtmlfiles \ marine.pdf 'startpage = no; 3 ODS noproctitle; 4 Data Marine; 5/* skip the Data Reading step */9 run; 10 proc print data = marine; 11 run; 12 * close the PDF files; 13 ods pdf close; [Options] 1. columns = N: Output in N column 2. startpage = value: Same as RTF; 3. style: printer by default.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.