SAS, log, output, and ODS output management

Source: Internet
Author: User

1: change log output to the specified external file

Log is usually output in the log window. The default output location can be changed using the printto process.

Proc printto log = "D: \ log.txt" New; * output the log to the specified file. "New" indicates that the previous file is overwritten. For more information, see the help document; proc print data = sashelp. class; proc printto; run; * Restore Default log output;

 2: Change output to the specified external file ???

Proc printto print = 'e: \ log.txt '; run; proc freq DATA = sashelp. Class; Table sex; run; proc printto; run;
/* If you do not know why the external file cannot be output, check it later */

3: Use ODS to change the output path

Filename outp 'C: \ Users \ Administrator \ Desktop \ mytestfortoday \ test.html '; ODS listing close; * change the default output path listing; ods html file = outp; * Open the specified path; proc univariate DATA = sashelp. class; var weight; run; ods html close; ODS listing;

4: Use ODS to output partial results of multiple process steps to external files

To write ODS, you must add the corresponding link. Otherwise, an error occurs in the next output.

Filename outp 'C: \ Users \ Administrator \ Desktop \ mytestfortoday \ test.txt '; ODS listing select basicmeasures quantiles; * select the output result range, which can be univariate. age. male. basicmeasures; ODS listing file = outp; * select the output file; proc univariate DATA = sashelp. class; var weight; run; proc freq DATA = sashelp. class; Table sex; run; ODS listing;

4:ODS results on/off

When the program is large, close the results pipeline whenever possible, otherwise it will occupy a lot of resources.

 

5: output the required ODS trace on/label object;

* List all modules that can be output during the process; ODS trace on/label; proc univariate DATA = sashelp. class; Class sex; var age; run;/* proc freq DATA = sashelp. class; * // * Table sex; * // * run; */ODS trace off;

* Example of a module;

Output added:
-------------
Name: extremeobsModule name after select
Label: Extreme Value observation
Template: Base. univariate. extobs
Path: univariate. Age. Male. extremeobs path. You can determine the module to be output.
Tag path: 'univariate procedure '. 'age'. 'sex = Male'. 'extreme value Inspector'Only after a tag is added.

 

6: odsouput converts the output object in the output window to the SAS dataset.

7: odshtml

8: odscsv

9: ODS select exclude

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.