You are on page 1of 73

ODS 101: Essential Concepts of the SAS Output Delivery System

Presented By:

Andrew H. Karp
Sierra Information Services, Inc.
19229 Sonoma Highway #264 Sonoma, California 95476 USA 707 996 7380 SierraInfo @ AOL.COM http://www.SierraInformation.com

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 01 Mar 03

Agenda/Topics
How does the ODS work? Understanding and working with
Objects/Tables Destinations

Destinations
OUTPUT Destination: working with SAS data sets created by ODS CSV, RTF, HTML and PDF Destinations Modifying the appearance of your output
2

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

The Output Delivery System


New to Version 8 of the SAS System
Was added to the SAS System in V7, but this Version was not around for very long

Set of tools to control the delivery of SAS-generated output Prior to Version 8 all Procedure-generated output was rendered as text and placed in the Output Window
Very little user control over content or display Often difficult to capture Procedure-generated output as SAS data sets Prior to Version 8, the Procedure generated the output

The Output Delivery System


Now, in Version 8:
Most procedures generate output and sends it to the Output Delivery System SAS PROCs that can generate output to the Output Window are said to support the Output Delivery System. This means
Their output is rendered as output objects Output objects are rendered as a function of their
Data component (the output generated by the PROC) Table component (rules for rendering data component)

Output objects are sent by SAS to ODS destinations The destination determines how the output will be rendered

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

The Output Delivery System


More on ODS Destinations
The default destination is LISTING
If you do nothing, all output is sent to the Output Window, just like in previous releases of SAS System software.

ODS Statements control


Which destinations are open/closed What will be output to the destination How the output will be portrayed/rendered

SAS continues to add new destinations to ODS


PDF (new in Release 8.1) XML (experimental in Release 8.2, is production in Version 9) CSV (experimental in Release 8.2, is production in Version 9)
5

The Output Delivery System


Some core suggestions for using ODS
If you set ODS LISTING CLOSE, dont forget to set ODS LISTING ON later on in your program
Remember to close all ODS destinations as soon as you are done sending output to them.

Be prepared to experiment and explore with ODS


It is a very powerful and complex part of the SAS System that takes some practice getting used to using

Dont spend lots of time making RTF, HTML or other types of ODSgenerated output until you are sure that your report/table/output is what you want it to look like Using the NOPRINT Option in a SAS Procedure disables the PROCs ability to send tables to the Output Delivery System
6

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

The Output Delivery System


An overview of how ODS works
Procedure generates Data Component and sends to ODS Data Component and Table Definitions are bound by the ODS to form an Output Object Output objects are sent by the ODS to the specified Destinations

How Does the Output Delivery System Work?


ODS-compliant SAS Procedure

Data Set

Data Component
Analyses, tables, etc.
Adapted from The Complete Guide to the SAS Output Delivery System (SAS Institute, 2001), page 22

Output Delivery System

Output Object
8

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

How Does the Output Delivery System Work?


Output Delivery System
ODS binds the Table Definition to the Data Component and creates the Output Object(s), which are then sent to Destinations

Output Object

ODS Destinations

LISTING

PDF

RTF

HTML

CSV OUTPUT
9

Adapted from The Complete Guide to the SAS Output Delivery System (SAS Institute, 2001), page 22

Understanding Tables, Objects and Destinations


OPTIONS nonumber nodate nocenter; * example 1: output objects; Proc Reg Data=SUGI28.regressdata; Model Depvar = Y1;

title1 'ODS for Data Analysts & Statisticians'; title2 'Objects and Destinations'; title3 'Default PROC REG Output: Simple Regression Model';

quit;

10

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

Understanding Tables, Objects and Destinations

RESULTS Window. By default, ODS has sent the output objects generated from the PROC REG output to the default LISTING (Output Window) Destination.
11

Understanding Tables, Objects and Destinations


Listing Destination (Output Window). What were used to seeing.

12

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

Understanding Tables, Objects and Destinations


The PROCLABEL Statement allows you to specify a Label for your procedure-generated output. The label appears in the Results Window, which facilitates identification of specific results/analyses in the Results Window.

* example 2: Residual Analysis;

ods proclabel = 'Ex 2: Residual Analysis';


proc reg data=sugi28.regressdata; title3 'Residual Analysis'; quit;

Model Depvar= Y1/r; *<==adding the R Option;

13

Understanding Tables, Objects and Destinations


Adding the r option to the MODEL Statement in PROC REG generated two new tables containing additional analyses. These tables are sent, along with the default tables, by the ODS to the LISTING Destination (i.e., the Output Window)

14

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

Understanding Tables, Objects and Destinations


Learning the Names of ODS Tables
ODS TRACE ON;
Writes table names and associated information to the SASLOG

ODS TRACE OFF;


Terminates writing of table names to the SASLOG

ODS TRACE ON/LISTING;


Writes table names and associated information to the LISTING Destination, just before the output table itself

Procedure Documentation
All ODS-compliant Procedures have a list of tables in their documentation
15

Learning the Names of ODS Tables

ODS TRACE ON;

ods proclabel = 'Ex 3: ODS TRACE ON/OFF'; proc reg data=sugi28.regressdata; model depvar = y1/r;
title3 'Residual Analysis with ODS TRACE ON/OFF';

quit;

ODS TRACE OFF;

16

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

Learning the Names of ODS Tables


SASLOG after ODS TRACE ON is executed. Information about tables generated is written to the SASLOG, where it can be reviewed.

17

Learning the Names of ODS Tables

18

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

Learning the Names of ODS Tables

* example 4: ODS TRACE ON/LISTING, ODS TRACE OFF;

ODS TRACE ON/LISTING;

ods proclabel = 'Ex 4: ODS TRACE ON/LISTING'; proc reg data=sugi28.regressdata; model depvar = y1/r; title3 'ODS TRACE ON/LISTING'; quit; ods trace off;

19

Learning the Names of ODS Tables


When the LISTING Option is specified with the ODS TRACE ON statement, table information is placed in the Output Window, rather than in the SASLOG. Some SAS users find this an easier way to identify which table is associated with what part of the Procedure-generated output than to have the table information written to the SASLOG.

20

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

10

Learning the Names of ODS Tables

21

Learning the Names of ODS Tables


All ODS-compliant SAS Procedures have a listing of table names in their respective chapters in both hardcopy and on-line SAS documentation. Here is an example from on-line documentation for PROC REG.

22

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

11

Learning the Names of ODS Tables

A (small) excerpt from the ODS Table Names segment of PROC REG documentation.
23

Working With Tables


What Have We Learned So Far?
ODS Receives Data Component(s) from a SAS Procedure and Renders it/them as Output Objects
ODS binds the Table Definition to the Data Component, resulting in an Output Object.

Output Objects are Sent by the ODS to Destinations The Default Destination is LISTING
The Output Window

How to Learn the Names of the Objects Created by the ODS.


ODS TRACE ON/OFF Procedure Documentation
24

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

12

Working with Tables


Now that weve mastered the basics
Selecting which Objects will be created Understanding persistence Creating SAS Data Sets using the OUTPUT Destination Working with ODS-generated SAS data sets

25

Selecting Tables
* example 5: Selection Lists/Persistence;

ods select fitstatistics;

ods proclabel = 'Ex 5A: Selection Lists / Persistence';

proc reg data=sugi28.regressdata; model depvar=y1;


title3 'ODS SELECT Statement'; quit;

ods proclabel = 'Ex 5B: Default Re-Set of Selection List'; proc reg data=sugi28.regressdata; model depvar = y2;
title3 'ODS Select Statement'; title4 'Persistence of Selection Lists'; quit;

26

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

13

Selecting Tables

By default, selection lists are re-set to ALL at the end of all (explicit or implicit) step boundaries.

27

Selecting Tables
* example 5: Selection Lists/Persistence; ods select fitstatistics; ods proclabel = 'Ex 5A: Selection Lists/Persistence'; proc reg data=sugi28.regressdata; model depvar=y1; title3 'ODS SELECT Statement';

quit;

ODS Selection List Re-Set to ALL At Step Boundary


ods proclabel = 'Ex 5B: Default Re-Set of Selection List'; proc reg data=sugi28.regressdata; model depvar = y2; title3 'ODS Select Statement'; title4 'Persistence of Selection Lists'; quit; 28

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

14

Creating SAS Data Sets from Procedure-Generated Output


The OUTPUT destination creates SAS data sets from Procedure-generated output
You can now convert your Procedure output to SAS data sets. You need to give SAS the:
Name of the table
See the Procedure documentation or Use ODS TRACE ON/TRACE OFF

Name of the data set to be created form the table


Both temporary and permanent SAS data sets can be created by ODS SAS Data Set Options can be used in the OUTPUT Destination statement to shape the data set.
29

Creating SAS Data Sets from ODS Objects


Objects sent to the OUTPUT Destination will be rendered as SAS data sets
Temporary SAS data sets (in the WORK library) Permanent SAS data sets (where a LIBREF has already been assigned/established) Objects sent to the OUTPUT Destination are for real SAS data sets. They contain
Descriptor Portion Data Portion (variables and observations/columns and rows)

Can be used/manipulated just like any other SAS data set created using other methods
Data Step Procedure Step
30

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

15

Creating SAS Data Sets from ODS Objects


* example 6: Output Destination; * contents of FITSTATISTICS Object Saved as Permanent SAS Data Set';

ods output fitstatistics = sugi28.fit1;

ods proclabel = 'EX6: Creating SAS Data Set from Output'; proc reg data=sugi28.regressdata; model depvar = y2; title3 'ODS Output Statement'; title4 'Creating SAS Data Sets from PROC Output'; quit; proc print data=sugi28.fit1; title3 'SAS Data Set Created from FITSTATISICS Object'; run; proc contents data=sugi28.fit1; title3 'Descriptor Portion Info for Data Set SUGI28.Fit1'; run;
31

Creating SAS Data Sets from ODS Objects

In this example, a permanent SAS data set was created from the FITSTATISTICS Object and stored in the folder with SUGI28 as its LIBREF. Since the LISTING Destination is always open by default, running the Procedure steps on the previous page resulted in having the ODS sent output to two Destinations: Listing (for all objects) and Output (for the Fitstatistics Object) 32

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

16

Creating SAS Data Sets from ODS Objects

SAS VIEWTABLE for data set SUGI28.FIT1, created by the ODS when the PROC REG-generated data component was rendered as a SAS data set using the OUTPUT Destination.

33

Creating SAS Data Sets from ODS Objects

The SAS System SAS Data Set Created from FITSTATISICS Object Obs Model Dependent Label1 1 MODEL1 DEPVAR Root MSE 2 MODEL1 DEPVAR Dependent Mean 3 MODEL1 DEPVAR Coeff Var c Obs nValue1 Label2 Value2 1 1038.936147 R-Square 0.7150 2 2109.386400 Adj R-Sq 0.7091 3 49.253003

cValue1 1038.93615 2109.38640 49.25300 nValue2 0.715042 0.709105

PROC PRINT Output showing observations and variables in SUGI28.FIT1


34

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

17

Creating SAS Data Sets from ODS Objects


Descriptor Portion Info for Data Set SUGI28.Fit1 The CONTENTS Procedure Data Set Name SUGI28.FIT1 Member Type DATA Engine V9 Created 14:44 Monday, March 3, 2003 Last Modified 14:44 Monday, March 3, 2003
Protection Data Set Type Label Data Representation Encoding Fit Statistics WINDOWS wlatin1 Western (Windows) Compressed Sorted

Observations Variables Indexes Observation Length Deleted Observations


NO NO

3 8 0 120 0

[Engine/Host Dependent Information Deleted]

Alphabetic List of Variables and # Variable Type Len 2 Dependent Char 32 3 Label1 Char 14 6 Label2 Char 8 1 Model Char 32 4 cValue1 Char 11 7 cValue2 Char 7 5 nValue1 Num 8 8 nValue2 Num 8

Attributes Format

PROC CONTENTS output for SAS data set SUGI28.FIT1


D12.3 D12.3

35

Closing the LISTING Destination


You can stop the ODS from sending output objects to the LISTING Destination (the Output Window.
This is particularly useful if you want your output tables sent to other destinations, but have no need for results to be placed in the Output Window. WARNING: The LISTING destination remains CLOSED until YOU
terminate your SAS Session, and subsequently re-start SAS,

or

Submit the ODS LISTING statement.


36

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

18

Opening/Closing ODS Destinations


By default:
The LISTING destination is OPEN unless you close it All other destinations are CLOSED until you open them Once open, all destinations remain open until you close them Hint
Dont keep destinations open longer than you have to, otherwise youll probably have more output than you know what to do with.

37

Closing the LISTING Destination


* example 7: Closing LISTING Destination;

ods listing close;

ods proclabel = 'Ex 7: Closing the LISTING Destination'; ods output fitstatistics = sugi28.fit2; ods output parameterestimates = sugi28.est1;
proc reg data=sugi28.regressdata; model depvar = y1; quit;

ods listing; * <== DONT FORGET!!;

In this example, the LISTING Destination is CLOSED while the OUTPUT Destinations are open ONLY for the FITSTATISTICS and PARAMETERESTIMATES Objects. After the explicit Step Boundary terminating the PROC REG task, the LISTING destination is re-set to ON so that output from subsequent SAS procedure steps will be displayed in the Output Window. 38

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

19

Closing the LISTING Destination

Since the LISTING Destination was CLOSED, and the OUTPUT Destinations were opened only for the FITSTATISTICS and PARAMETERESTIMATES Objects, the Results Window shows that we have two SAS data sets, and no other output, generated from the PROC REG task in Example 7.

39

Using ODS to Create Output Reports


We will now look at the
CSV PDF HTML RTF

Comma Separated Values Portable Document File Hypertext Markup Language Rich Text Format

ODS Destinations

We will also see the use of


SAS-supplied Templates ODS Style Definitions with PROCs PRINT and REPORT
40

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

20

The CSV Destination


Experimental in Release 8.2
Production in Version 9 Renders output as a Comma Separated Values (CSV) File
A text file with commas that separate the values of the variables Useful if you want to convert the output to a spreadsheet file
CSV is a text format, and can be read by most spreadsheet products

41

The CSV Destination

%let path = C:\Documents and Settings\Administrator \Desktop\SUGI28;

* ex 17: CSV Destination; options symbolgen; ods listing close; ods select parameterestimates; ods CSV file = "&path\parameters.csv"; proc reg data=sugi28.regressdata; model depvar = &best; title2 'Optimal Subset Selection with ODS'; quit; ods csv close; ods listing;

42

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

21

The CSV Destination


67 %let path = C:\Documents and Settings\Administrator\Desktop\SUGI28; 68 * ex 17: CSV Destination; 69 options symbolgen; 70 ods listing close; 71 ods select parameterestimates; 72 ods CSV file = "&path\parameters.csv"; SYMBOLGEN: Macro variable PATH resolves to C:\Documents and Settings\Administrator\Desktop\SUGI28 NOTE: Writing CSV Body file: C:\Documents and Settings\Administrator\Desktop\SUGI28\parameters.csv 73 proc reg data=sugi28.regressdata; 74 model depvar = &best; SYMBOLGEN: Macro variable BEST resolves to Y2 Y3 Y4 Y6 Y7 75 title2 'Optimal Subset Selection with ODS'; 76 quit;
NOTE: 50 observations read. NOTE: 50 observations used in computations. NOTE: PROCEDURE REG used (Total process time): real time 0.19 seconds cpu time 0.07 seconds

77 78

ods csv close; ods listing;

43

The CSV Destination

44

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

22

The CSV Destination

45

The CSVALL Destination


New to SAS Version 9, the CSVALL Destination:
Creates a Comma Separated Values file from your SAS output File includes
Titles Footnotes By-lines

46

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

23

The CSVALL Destination


* EX 20: CSVALL DESTINATION; %let path = C:\Documents and Settings\Administrator\Desktop\SUGI28; ods select parameterestimates; ods listing close; ods csvall file="&path\csvall_example.csv"; title1 'ODS for Data Analysts and Statisticians'; title2 'Multiple Regression Analysis'; footnote1 'SUGI 28 Sunday Seminar'; footnote2 'Using the New CSVALL Destination'; proc reg data=sugi28.regressdata; model depvar=y1-y7; quit; ods csvall close; ods listing;

47

The CSVALL Destination

48

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

24

The RTF Destination


The Rich Text Format (RTF) destination creates files that are easily imported in to Microsoft Office products such as
Microsoft Word Microsoft Powerpoint

The RTF destination is pretty simple and straightforward. Here is an example.

49

The RTF Destination


* ex 18A: rtf destination; %let path = C:\Documents and Settings\Administrator\Desktop\SUGI28; options symbolgen date number; ods listing close;

ods rtf file = "&path\reg1.rtf" bodytitle;


proc print data=bestsubset; title1 'ODS for Data Analysts and Statisticians'; title2 'Optimal Subset Selection with ODS'; title3 'RTF Destination: Default Style'; run; ods rtf close; ods listing;

50

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

25

The RTF Destination


The screen capture on the previous page shows the results of specifying the RTF destination
By default, the RTF destination puts the TITLES and FOOTNOTES (if any) in the headers and footers of the RTF document
The BODYTITLE option is used with the RTF destination to override this default

51

From SAS Technical Support

An important note from the SAS Tech Support Web Site regarding problems using the BODYTITLE option with the RTF destination. It will only work if the DATE and NUMBER System Options are in effect.

52

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

26

The RTF Destination

53

The RTF Destination


Some comments
In this example the default commands for setting colors, font sizes, shading, etc were used. In subsequent examples we will see how to control the presentation of the output.
STYLE Definitions in PROC REPORT PROC TEMPLATE

54

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

27

Specifying a STYLE
Here is an example of specifying a STYLE when generating an RTF file
options date number; ods listing close; ods rtf file = 'bestsubsets2.rtf' BODYTITLE style=d3d; proc print data=sbc label obs='Model'; title1 'SAS ODS for Data Analysts and Statisticians'; title2 'Working with Output Data Sets'; title3 'Optimal Subset Selection: Logistic Regression Model'; title4 'Using the D3D Style'; run; ods rtf close; ods listing;

55

Specifying a STYLE

56

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

28

Specifying a STYLE

57

Specifying a STYLE

Science Style is new to SAS Version 9


58

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

29

Understanding Styles

options nonumber nodate nocenter;

proc template; list styles;

title1 'ODS for Data Analysts and Statisticians'; title2 'SAS-Supplied STYLES in Version 9';

run;

59

The PDF Destination


Added in Release 8.2 of the SAS System The PDF destination creates a Portable Document File
Easy to send SAS output to someone who uses the Acrobat Reader to look at PDF files Report recipient does not need SAS Software to read the report/analysis when SAS output is rendered as a PDF document using the PDF Destination.

60

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

30

The PDF Destination


Example: create a Portable Document File with several analyses from a marketing response/predictive modeling project
All the analyses will be placed in one PDF file.
Thats because the PDF destination remains OPEN until it is CLOSED.

A table of contents is automatically generated for the PDF file


If you dont want one, include the NOTOC option in the ODS PDF Destination statement.
ODS PDF NOTOC file = filename;

61

The PDF Destination


* create a PDF file; ods listing close; options nonumber nodate nocenter ls=80; %let path= C:\Documents and Settings\Administrator\My Documents\Files from Destop #1\SAS Class Materials\Reporting Class Materials and Data Sets ; ods listing close; ods pdf file = "&path\best_sub_default.pdf" style=default; proc format; value resfmt 1 = 'Responder' 0 = 'Non Responder'; value sdbfmt 1 = 'Yes' 0 = 'No'; run; Ods proclabel 'Frequency Distributions'; proc freq data=sasclass.training; format respond resfmt.; tables respond*(branch res sdb); title1 'SAS ODS for Data Analysts and Statisticians'; title2 'Using the PDF Destination'; title3 'Marketing Campaign Response Analysis'; title4 'Response by Customer Branch and Residence Code'; run;

62

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

31

The PDF Destination


ods proclabel 'Analysis of Continuous Level Variables'; proc means maxdec=0 mean n nmiss range median data=sasclass.training; class respond; var income teller ddabal ccbal checks phone ATM; title4 'Analyzing Response/Non-Response By'; title5 'Income, Teller, DDA Balance, Credit Card Balance'; title6 'Phone Banking and ATM Usage'; run; ods proclabel 'Predictive Model #1: All Independent Variables'; ods select parameterestimates; proc logistic data=sasclass.training DESC; model respond=ACCTAGE ATM CCBAL CHECKS DDABAL DEP DIRDEP MOVED PHONE SDB TELLER; title4 'All Independent Variables'; run; ods proclabel 'Predictive Model #2: Stepwise Selection'; ods select modelbuildingsummary; proc logistic data=sasclass.training desc; model respond=ACCTAGE ATM CCBAL CHECKS DDABAL DEP DIRDEP MOVED PHONE SDB TELLER/selection=stepwise; title4 'Stepwise Selection: Model Building Summary'; run; ods pdf close; ods listing;

63

The PDF Destination

64

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

32

The HTML Destination


This destination creates files using the Hypertext Markup Language, or HTML
The HTML destination includes several options to create
Table of Contents Table of Pages

Example:
Use PROC CORR to generate correlation coefficients among several variables and output results to an HTML file Use PROC REG to create several linear regression models and output results to the same HTML file in which the PROC CORR output was sent.
65

The HTML Destination


ods listing close; ods html body="&path\reg1.htm"; ods proclabel Correlations; Proc corr nosimple data=advrept.finance; var retcap wcftcl wcftdt gearrat logsale; ods proclabel 'Regression Analyses'; Proc Reg Data=advrept.Finance; label retcap = 'Return on Capital'; * var statement; var retcap wcftcl wcftdt gearrat logsale; First_Model:Model RETCAP= WCFTCL; title 'First_Model:Model RETCAP= WCFTCL'; run; Second_Model:model retcap = wcftdt; title 'Second Model: model retcap = wcftdt';

Page one of SAS Program

66

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

33

The HTML Destination


Third_Model:model retcap = gearrat; title 'Third_Model:model retcap = gearrat'; run; Fourth_Model:model retcap=logsale; title 'Fourth_Model:model retcap=logsale'; run; Fifth_Model:model retcap = wcftcl wcftdt gearrat logsale; title 'Fifth Model: Multiple Regression'; quit; *terminates Proc Reg task; ods html close; ods listing;

Page two of SAS Program

67

The HTML Destination

HTML output displayed in the SAS Results Viewer.

68

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

34

The HTML Destination

69

The HTML Destination


Adding a Table of Contents and Table of Pages
The next example shows how to create both, but you can just make one, or the other, as required.
ods listing close; ods select all; ods html path="&path" body='regbody.html' frame='regframe.html' contents='regcontents.html' page='regpage.html'; These ODS HTML statements will create an HTML file containing the output from the PROC CORR and PROC REG steps shown earlier. The HTML file will contain the Procedure generated output, plus a Table of Contents and a Table of Pages for easy navigation. 70

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

35

The HTML Destination


HTML output with a Table of Contents (top left) and Table of Pages (bottom left). Using the ODS PROCLABEL statement customized the labels in both tables.

71

The HTML Destination


HTML output with a Table of Contents (top left) and Table of Pages (bottom left). Using the ODS PROCLABEL statement customized the labels in both tables.

72

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

36

Summary/Conclusions

End of ODS 101

73

ODS 201: Making Life Easier with the SAS Output Delivery System
Presented By:

Andrew H. Karp
Sierra Information Services, Inc.
19229 Sonoma Highway #264 Sonoma, California 95476 USA 707 996 7380 SierraInfo @ AOL.COM http://www.SierraInformation.com

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 01 Mar 03

74

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

37

Persistence of Object Selection/Exclusion


The selection or exclusion of objects is said to persist for the duration of a procedure
More formally, the selection/exclusion supports rungroup processing (for most PROCs). At the end of a run-group, either explicit or implicit:
the selection list is re-set to ALL Unless the PERSIST option is used.

75

Persistence of Object Selection/Exclusion


ods select fitstatistics; ods output fitstatistics=model1; ods proclabel = 'Respond=Customer Age'; proc logistic data=sugi28.predmodel descending; model respond = customer_age; title 'ODS for Data Analysts and Statisticians'; title2 'Predictive Modeling'; run; (Explicit Step Boundary) ods output fitstatistics = model2; ods proclabel = 'Respond=Risk Score'; proc logistic data=sugi28.predmodel descending; model respond = risk_score; run; This example demonstrates run-group persistence of ODS object selection. The ODS SELECT FITSTATISTICS statement is applied to the first PROC LOGISTIC task, but was not applied to the second task. Why? Because the selection list was automatically reset to ALL after the first run-group completed processing. 76

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

38

Persistence of Object Selection/Exclusion


This example demonstrates run-group persistence of ODS object selection. The ODS SELECT FITSTATISTICS statement is applied to the first PROC LOGISTIC task, but was not applied to the second task. Why? Because the selection list was automatically reset to ALL after the first run-group completed processing. What we need is a way to have the selection remain in effect, or persist across Procedure Steps.

77

Persistence of Object Selection/Exclusion


* Example 9: The Persist Option; ods select fitstatistics(persist); ods output fitstatistics=sugi28.model1; ods proclabel = 'Ex 9a: Respond = Customer Age'; proc logistic data=sugi28.predmodel descending; model respond = customer_age;
title 'ODS for Data Analysts and Statisticians'; title2 'Predictive Modeling';

run;

ods output fitstatistics = sugi28.model2; ods listing close; ods proclabel = 'Ex 9b: Respond=Risk Score'; proc logistic data=sugi28.predmodel descending; model respond = risk_score; run; Continued on next page ods listing;

78

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

39

Persistence of Object Selection/Exclusion


ods output fitstatistics = sugi28.model3; ods proclabel = 'Ex 9c: Respond = Income'; proc logistic data=sugi28.predmodel descending; model respond = income; run; ods select all; *<=== re-set selection list;
This example demonstrates how the PERSIST option in the ODS SELECT statement is used to over-ride the default reset of the object selection list at the end of each PROC LOGISTIC step. This selection will now remain in effect (persist) for all applications of PROC LOGISTIC, until the selection list is explicitly re-set by using ODS SELECT ALL, as is shown above,
79

Persistence of Object Selection/Exclusion

The Results Window on the left shows the results of applying the PERSIST option in the ODS SELECT statement. Only the FITSTATISTICS Object is created by each PROC LOGISTIC task. Using ODS LISTING CLOSE/ODS LISTING for Example 9b further restricted the output to just a SAS data set.

80

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

40

Persistence of Object Selection Across Procedure Steps


Using the PERSIST=PROC and MATCH_ALL options in the ODS OUTPUT Statement

PERSIST=PROC instructs SAS to keep the the selection or exclusion lists in effect after a procedure step boundary MATCH_ALL instructs SAS to create a new SAS data set for each object it creates
When only one data set is created, the data set name created is the one specified in the ODS OUTPUT statement. When multiple data sets are created, then SAS appends digits to the name of the data set given in the ODS OUTPUT statement

81

Persistence of Object Selection Across Procedure Steps


Task: Compare five logistic regression models
Use the AIC (Akaike Information Criterion) to assess better versus worse models

Steps:
Have ODS create a SAS data set containing the AIC for each of the five models. Use SAS data set options to shape each output data set so they contain just the observations/variables needed at subsequent points in the process

82

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

41

Persistence of Object Selection Across Procedure Steps


Initial step:
run one model and look at output SAS data set

Once we know what the output data set looks like, write the ODS OUTPUT Statement so that
Only the desired observations/variables are output to the data sets
SAS data set options are applied to the output data sets

A new data set is created for each logistic regression model


The MATCH_ALL Option

83

Persistence of Object Selection Across Procedure Steps


options nodate nonumber nocenter;

ods listing close; * close listing destination; ods select fitstatistics; * select fitstatistics table; ods output fitstatistics=fit_test; * run one model to see what we get; proc logistic data=predmodel descending; model respond=income; run; ods listing; * re-open listing destination; proc print data=fit_test;
title1 'ODS for Data Analysts and Statisticians'; title2 'Comparing Logistic Regression Models'; title3 'FITSTATISTICS Object as a SAS Data Set'; run;

84

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

42

Persistence of Object Selection Across Procedure Steps


ODS for Data Analysts and Statisticians Comparing Logistic Regression Models FITSTATISTICS Object as a SAS Data Set Intercept Only 9511.900 9518.813 9509.900 Intercept And Covariates 9513.251 9527.076 9509.251

Obs 1 2 3

Criterion AIC SC -2 Log L

85

Persistence of Object Selection Across Procedure Steps


ods output fitstatistics(persist = proc match_all) = AIC(where=(upcase(criterion) = 'AIC') drop = _run_ _proc_); Statement/Option
PERSIST=PROC MATCH_ALL (PERSIST=PROC MATCH_ALL)=AIC WHERE clause
option

What It Does
Output Destination remains open across multiple procedure step boundaries Create a new data set each time an Object is sent to the OUTPUT Destination AIC is the name of the first data set created, subsequent data sets are named AIC1, AIC2, etc. Restricts observations in output data set to those satisfying conditions in the WHERE clause Drops the automatically created variables _RUN_ and _PROC_ from each output data set 86

DROP

SAS data set

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

43

Persistence of Object Selection Across Procedure Steps


ods listing close; * close listing destination; ods select fitstatistics; * select fitstatistics table; ods output fitstatistics(persist = proc match_all) = AIC( where=(upcase(criterion) = 'AIC') drop = _run_ _proc_);

proc logistic data=predmodel descending; model respond=income; run; proc logistic data=predmodel descending; model respond=credit_card_balance; run; proc logistic data=predmodel descending; model respond=risk_score; run; proc logistic data=predmodel descending; model respond = length_of_residence; run; proc logistic data=predmodel descending; model respond = income credit_card_balance risk_score length_of_residence; run;

ods select all; * reset selection list; ods listing; * reset listing destination to ON;

87

Persistence of Object Selection Across Procedure Steps

88

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

44

Persistence of Object Selection Across Procedure Steps


proc print data=aic; title 'ODS for Data Analysts & Statisticians'; title2 'Data Set AIC'; run;

89

Persistence of Object Selection Across Procedure Steps


data compare; length indepvar $ 20; set aic(in=a) aic1(in=b) aic2(in=c) aic3(in=d) aic4(in=e); if a then indepvar = 'Income'; else if b then indepvar = 'Credit_Card_Balance'; else if c then indepvar = 'Risk_Score'; else if d then indepvar = 'Length_of_Residence'; else if e then indepvar = 'All Variables'; run; proc print data=compare; title 'ODS for Data Analysts & Statisticians'; title2 'Comparing AIC Statistics for Logistic Regression Models'; run; 90

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

45

Persistence of Object Selection Across Procedure Steps

91

Concatenating ODS-generated Data Sets in a Data Step


When the MATCH_ALL and PERSIST options are used in the ODS OUTPUT statement, a separate data set is created for each output object.
In many situations the next step in the project would be to concatenate them in to one big data set. This is easily accomplished by specifying a macro variable name as part of the MATCH_ALL option.
SAS then stores the names of all the data sets it creates in a macro variable which can be used in a subsequent data step.

92

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

46

Concatenating ODS-generated Data Sets in a Data Step


ods proclabel = 'EX 11: Creating Macro Var'; ods select parameterestimates;

ods output parameterestimates (match_all=macrovar) = Results;


proc logistic data=predmodel descending;

by Territory;

model respond = income credit_card_balance risk_score length_of_residence; run; This Procedure Step will generate parameter estimates for three separate models, one for each value of the variable Territory. The ODS OUTPUT Statement will create three separate SAS data sets holding the parameter estimates. Their names are RESULTS, RESULTS1 and RESULTS2. A variable in the Macro Symbol Table (SASHELP.VMACRO) called MACROVAR, holds the names of the data sets. 93

Concatenating ODS-generated Data Sets in a Data Step

94

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

47

Concatenating ODS-generated Data Sets in a Data Step


* ex 12: concatenate separate data sets;

options symbolgen;

data combine; set &macrovar; run;


proc print data=combine; title1 'ODS for Data Analysts & Statisticians'; title2 'Combining ODS-generated Data Sets'; run;

The SYMBOLGEN SAS System option controls whether the results of macro symbol resolutions are written to the SASLOG. The shipped default option setting is NOSYMBOLGEN.
95

Concatenating ODS-generated Data Sets in a Data Step


645 646 647 * ex 12: concatenate separate data sets; options symbolgen; data combine;

SYMBOLGEN: Macro variable MACROVAR resolves to RESULTS RESULTS1 RESULTS2


648 649 set &macrovar; run;

NOTE: There were 5 observations read from the data set WORK.RESULTS. NOTE: There were 5 observations read from the data set WORK.RESULTS1. NOTE: There were 5 observations read from the data set WORK.RESULTS2.
NOTE: DATA statement used (Total process time): real time 0.13 seconds cpu time 0.07 seconds

NOTE: The data set WORK.COMBINE has 15 observations and 7 variables.

96

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

48

Concatenating ODS-generated Data Sets in a Data Step


ODS for Data Analysts & Statisticians Combining ODS-generated Data Sets Obs 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 territory Great Basin Great Basin Great Basin Great Basin Great Basin Pacific NW Pacific NW Pacific NW Pacific NW Pacific NW South West South West South West South West South West Variable Intercept INCOME credit_card_balance risk_score length_of_residence Intercept INCOME credit_card_balance risk_score length_of_residence Intercept INCOME credit_card_balance risk_score length_of_residence DF 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Estimate -1.1353 0.000857 1.403E-6 0.000732 -0.00733 0.0885 0.00116 2.307E-8 -0.00141 0.0208 -0.6265 0.000237 3.617E-6 -0.00011 -0.00261 StdErr 0.7067 0.00144 8.888E-7 0.00106 0.0147 0.8009 0.00173 8.991E-7 0.00120 0.0171 0.6573 0.00146 1.312E-6 0.000981 0.0140 WaldChiSq 2.5809 0.3553 2.4923 0.4803 0.2478 0.0122 0.4508 0.0007 1.3806 1.4855 0.9084 0.0265 7.6008 0.0133 0.0350 Prob ChiSq 0.1082 0.5511 0.1144 0.4883 0.6187 0.9120 0.5019 0.9795 0.2400 0.2229 0.3405 0.8706 0.0058 0.9082 0.8516

97

Persistence of ODS Object Creation With Run-Group Processing


Some SAS Procedures support run group processing
PROC REG PROC PLOT PROC ARIMA (SAS/ETS Software)
The PERSIST=RUN statement is used to generate output objects with PROCs that support run-group processing

98

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

49

Persistence of ODS Object Creation With Run-Group Processing


Task:
Run several linear regression models (with a common dependent variable) Output just the R-square (coefficient of determination) value from each model to SAS data sets Concatenate the R-square values in to one data set Sort values from highest to lowest Print results
Do not sent output to the LISTING destination (the Output Window)
99

Persistence of ODS Object Creation With Run-Group Processing


* Ex 13: Run-Group Persistence; ods output fitstatistics(match_all=outlist persist = run) = fit (keep=model label2 cvalue2 where=(upcase(label2) =: 'R-SQ')); ods listing close; proc reg data=sugi28.regressdata; var depvar y1-y7; Y1 : Model depvar = Y1; This PROC REG task shows run; how multiple models are Y2 : Model depvar = Y2; generated in a single use of run; Y3 : Model depvar = Y3; the procedure. The LISTING run; destination is CLOSED, so Y4 : Model depvar = Y4; only the SAS data sets run; described in the ODS Y5 : Model depvar = Y5; OUTPUT STATEMENT are run; created. The LISTING Y6 : Model depvar = Y6; destination is re-set to on run; Y7: Model depvar = Y7; at the end of the PROC REG quit; task.
ods listing; ods output clear;

100

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

50

Persistence of ODS Object Creation With Run-Group Processing


Since the listing destination was closed, the only ODS destination open when the PROC REG task executed was the OUTPUT destination. The only output therefore generated by PROC REG task were the SAS data sets containing the specified elements from the FITSTATISTICS object.

101

Persistence of ODS Object Creation With Run-Group Processing

SAS Data Set created by ODS. Notice that variable label (Y1) is captured by the variable named Model and that variable Label2 stores the name of the statistic of interest (R-Square). Finally, variable Cvalue2 hold the computed value of R-Square (0.8895).

102

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

51

Persistence of ODS Object Creation With Run-Group Processing

103

Persistence of ODS Object Creation With Run-Group Processing


options symbolgen; data combine( rename=(cvalue2 = value label2 = statistic)); set &outlist; run; proc sort data=combine; by descending value; run; proc print data=combine; title2 'R-Square Statistics for Seven Linear Regression Models'; title3 'Sorted in Descending Value'; run;
The macro variable OUTLIST contains the names of all the data sets created when the PROC REG task on the previous page executed. They are concatenated in this data step and then printed. After a PROC SORT step, the data set contains the results from lowest to highest value of R-square

104

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

52

Persistence of ODS Object Creation With Run-Group Processing


ODS for Data Analysts and Statisticians R-Square Statistics for Seven Linear Regression Models Sorted in Descending Value Obs 1 2 3 4 5 6 7 Model Y7 Y2 Y1 Y6 Y5 Y4 Y3 statistic R-Square R-Square R-Square R-Square R-Square R-Square R-Square value 0.8895 0.7150 0.2927 0.2154 0.0385 0.0049 0.0009

105

Working with ODS Objects: Another Example


In the previous example
Several SAS data sets from FITSTATISTICS Objects were created, one for each linear regression model
The R-Square values from the data sets were concatenated in to one big data set, and then ordered from highest (better) to lowest (worse) value.

The statistics of interest were stacked in to one data set The stacked data set was then sorted in descending value of the R-square statistic, thus putting the best model at the top of the data set.
106

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

53

Assessing Competing Multiple Linear Regression Models Using ODS


In the next example, ODS is used to facilitate selection of an optimal or best subset of independent variables
When SELECTION = ADJRSQ (Adjusted R-Square) is specified as an option in the MODEL Statement the SUBSETSELSUMMARY (Subset Selection Summary) Object is created. This object is rendered as a SAS data set, according to the instructions in the program on the next page, and some of its observations are shown on the page following the code sample.
107

Assessing Competing Multiple Linear Regression Models Using ODS


* EX 16: Optimal Subset Selection; ods select subsetselsummary; ods output subsetselsummary=allpossiblemodels( drop=control model); ods listing close; proc reg data=sugi28.regressdata; model depvar=y1-y7/selection=adjrsq; quit; ods listing; proc print data=allpossiblemodels(obs=10); title2 'Data Set Allpossiblemodels'; title3 'First 10 observations'; run;
108

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

54

Assessing Competing Multiple Linear Regression Models Using ODS


SAS ODS for Data Analysts & Statisticians Data Set Allpossiblemodels First 10 observations Obs 1 2 3 4 5 6 7 8 9 10 Dependent DEPVAR DEPVAR DEPVAR DEPVAR DEPVAR DEPVAR DEPVAR DEPVAR DEPVAR DEPVAR NumIn Model 5 4 6 6 3 5 5 4 7 4 Adjrsq 0.9098 0.9088 0.9083 0.9079 0.9078 0.9075 0.9069 0.9067 0.9063 0.9060 RSquare 0.9190 0.9162 0.9196 0.9192 0.9135 0.9169 0.9164 0.9143 0.9197 0.9137 VarsInModel Y2 Y2 Y1 Y2 Y2 Y1 Y2 Y2 Y1 Y2 Y3 Y3 Y2 Y3 Y6 Y2 Y3 Y4 Y2 Y5 Y4 Y6 Y3 Y4 Y7 Y3 Y5 Y6 Y3 Y6 Y6 Y7 Y7 Y4 Y6 Y7 Y5 Y6 Y7 Y6 Y7 Y6 Y7 Y7 Y4 Y5 Y6 Y7 Y7

109

Assessing Competing Multiple Linear Regression Models Using ODS


The first observation in the output data set contains the combination of independent variables that maximizes the adjusted coefficient of determination (adjusted R-square)
The adjustment is to add a penalty to models that have too many or extraneous independent variables

110

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

55

Assessing Competing Multiple Linear Regression Models Using ODS


By applying a combination of
Data Step functionalities Macro Language functionalities

We can have the independent variables for the winning (statistically optimal model) output to a macro variable, and then used in a subsequent PROC REG task to generate parameter estimates and other measures of model performance for the optimal subset of independent variables.
111

Assessing Competing Multiple Linear Regression Models Using ODS


The Data _NULL_ step creating data set winner reads the just first observation from data set ALLPOSSIBLEMODELS. Data set WINNER therefore contains the (statistically) best combination of independent variables according to the adjusted R-square measure.

data _null_; set allpossiblemodels(obs=1); call symput('best',varsinmodel); run; options symbolgen; ods output parameterestimates = bestsubset; proc reg data=sugi28.regressdata; model depvar = &best; title2 'Optimal Subset Selection with ODS'; quit;
112

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

56

Assessing Competing Multiple Linear Regression Models Using ODS


32 33 34 35 data _null_; set allpossiblemodels(obs=1); call symput('best',varsinmodel); run;

NOTE: There were 1 observations read from the data set WORK.ALLPOSSIBLEMODELS. NOTE: DATA statement used (Total process time): real time 0.36 seconds cpu time 0.12 seconds 36 37 options symbolgen; 38 ods output parameterestimates = bestsubset; 39 proc reg data=sugi28.regressdata; 40 model depvar = &best; SYMBOLGEN: Macro variable BEST resolves to Y2 Y3 Y4 Y6 Y7 41 title2 'Optimal Subset Selection with ODS'; 42 quit;

113

Assessing Competing Multiple Linear Regression Models Using ODS


SAS ODS for Data Analysts & Statisticians Optimal Subset Selection with ODS The REG Procedure Model: MODEL1 Dependent Variable: DEPVAR Dependent Variable Analysis of Variance Source Model Error Corrected Total Root MSE Dependent Mean Coeff Var DF 5 44 49 578.37083 2109.38640 27.41891 Sum of Squares 167099839 14718564 181818403 R-Square Adj R-Sq Mean Square 33419968 334513 F Value 99.91 Pr > F <.0001

0.9190 0.9098 Parameter Estimates

Variable Intercept Y2 Y3 Y4 Y6 Y7

Label Intercept Indep Var Indep Var Indep Var Indep Var Indep Var 2 3 4 6 7

DF 1 1 1 1 1 1

Parameter Estimate 725.49281 0.95415 -0.94966 -0.80240 -0.96079 14.17711

Standard Error 396.60873 0.36286 0.59232 0.64717 0.53696 1.42848

t Value 1.83 2.63 -1.60 -1.24 -1.79 9.92

Pr > |t| 0.0741 0.0117 0.1160 0.2216 0.0804 <.0001

114

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

57

Review
So far, weve seen some ODS capabilities:
Create/manage output objects
Selection of objects Persistence of selection lists across PROC or RUN groups
PERSIST=PROC or PERSIST = RUN MATCH_ALL MATCH_ALL=macrovar

ODS PROCLABEL statement ODS Destinations


OUTPUT : to create a SAS data set
Using SAS data set options in the ODS OUTPUT statement

LISTING : control what is sent to the output window


ODS LISTING CLOSE/ODS LISTING
115

Traffic Lighting
Traffic Lighting refers to process of displaying different colors to the values of variables based on some decision rule.
This process is very easy to implement in PROCs REPORT and TABULATE Example: using the regression analysis results data set, portray the value of the variable representing pvalue as:
Green if the p-value is less than .05 Blue if the p-value is between .05 and .10 Red if the p-value is greater than .10
116

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

58

Traffic Lighting

How can we assign colors to the p-values?

117

Traffic Lighting
This example of traffic lighting was created by:
Generating a format Applying the format and other ODS style definitions within PROC REPORT
proc format; value pvalf low - .0499999 = 'green' .05 - .0999999 = 'blue' .1 - high = 'red'; run;

118

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

59

Traffic Lighting
options nonumber nodate nocenter; ods listing close; ods pdf file = "&path\bestsubset.pdf" style=sasweb; proc report data=bestsubset split = '/' nowindows; column Variable DF Estimate StdErr tValue Probt Label ; define dependent/display 'Dependent/Variable' style(column)=[font_weight=bold]; define DF/display 'Degrees/of/Freedom'; define estimate/display 'Parameter/Estimate' style(column)=[font_weight=bold]; define stderr/display 'Standard/Error' ; define tvalue/display 'Test/Statistic';

define probt/'P/Value' style(column)=[foreground=pvalf. font_weight=bold];


define label/'Variable/Label' style(column)=[fontweight=bold]; title1 'ODS for Data Analysts and Statisticians'; title2 'Parameter Estimates from Best Subset'; title3 'SASWEB ODS Style w/Style Elements Added in PROC Report'; run; ods pdf close; ods listing;

119

Traffic Lighting

120

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

60

Using the HTML Destination to Create Excel Spreadsheets


An XLS Destination is not available Instead, use the
HTML Destination Use XLS as the file extension
Excel can read HTML files!

121

Using the HTML Destination to Create Excel Spreadsheets


ods listing close;

ods html file = "&path\bestsubset.xls" style=sasweb;

proc report data=bestsubset split = '/' nowindows; column Variable DF Estimate StdErr tValue Probt Label ; define dependent/display 'Dependent/Variable' style(column)=[font_weight=bold]; define DF/display 'Degrees/of/Freedom'; define estimate/display 'Parameter/Estimate' style(column)=[font_weight=bold]; define stderr/display 'Standard/Error' ; define tvalue/display 'Test/Statistic'; define probt/'P/Value' style(column)=[foreground=pvalf. font_weight=bold]; define label/'Variable/Label' style(column)=[fontweight=bold]; title1 'ODS for Data Analysts and Statisticians'; title2 'Parameter Estimates from Best Subset'; title3 'Creating an Excel Spreadsheet from the ODS HTML Destination'; run; ods html close; ods listing;

122

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

61

Using the HTML Destination to Create Excel Spreadsheets

123

One More Example: Using ODS Style Statements in PROC REPORT Question:
How can I traffic-light an entire row of my PROC REPORT-generated output based on the values of one of the columns (variables) in the report?
Previously, we assigned colors to the individual values of the variables by applying a user-created Format (PVALF.) How can I change the appearance of an entire row of the output report?

Example: if the p-value is less than .05, make the entire row yellow and the text italic.

124

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

62

One More Example: Using ODS Style Statements in PROC REPORT


* ex 23: assign color to row based on p-value; options nonumber nodate nocenter; ods listing close; ods pdf file = "&path\bestsubset2.pdf" style=sasweb;

proc report data=bestsubset split = '/' nowindows style(header)=[font_weight=bold foreground=orange];


column define define define define define define

Variable DF Estimate StdErr tValue Probt Label ; variable/display 'Dependent/Variable' style(column)=[font_weight=bold]; DF/display 'Degrees/of/Freedom'; estimate/display 'Parameter/Estimate' style(column)=[font_weight=bold]; stderr/display 'Standard/Error' ; tvalue/display 'Test/Statistic'; probt/display 'P/Value' style(column)=[font_weight=bold]; define label/'Variable/Label' style(column)=[font_weight=bold];

125

One More Example: Using ODS Style Statements in PROC REPORT


compute probt; if probt <= .05 then do; call define(_row_,"STYLE", "STYLE=[background=gold font_style=italic]"); end; else if probt > .05 then do; call define(_row_,"STYLE","STYLE=[background=white]"); end;
title1 title2 title3 title4 endcomp; 'ODS for Data Analysts and Statisticians'; 'Parameter Estimates from Best Subset'; 'Using ODS Style Statements in PROC REPORT to Identify'; 'Statistically Significant Parameter Estimates';

run; ods pdf close; ods listing;

126

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

63

One More Example: Using ODS Style Statements in PROC REPORT

127

Whats New In SAS 9/9.1?


New ODS Destinations PROC DOCUMENT
Production in 9.0

ODS Statistical Graphics


Experimental in 9.1

128

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

64

PROC DOCUMENT
The new DOCUMENT destination allows you to
Store ODS objects in raw form as documents Documents can be
Modified/edited Replayed Saved for future use

129

The Document Window

Submitting the ODSDOCUMENT command opens the new (to SAS 9) Document Window

dm 'odsdocument';
The Document Window can also be opened with the DM (Display Manager) Command

130

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

65

The ODS DOCUMENT Statement


ods document name=mydoc1 ;
ods proclabel 'Predictive Model'; proc logistic data=sasdata.insurance descending; format ins insfmt.; model ins= ddabal acctage atmamt crscore income posamt savbal/ selection = stepwise ctable pprob = .10 to .50 by .10; title 'Global Title1: A Peek at PROC DOCUMENT'; title2 'Predictive Model via PROC LOGISTIC'; run;

ods document close;

By opening (and then closing) the DOCUMENT Destination, a document called MYDOC1 is created and shown in the DOCUMENT Window. By default, documents are temporary files and are stored in the WORK Library. 131

The ODS DOCUMENT Statement

Document Destination Icons in the Document Window. New to Version 9

132

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

66

Working in the DOCUMENT Window


Output Destinations can now be specified from the Open As window. This permits you to send objects to multiple output destinations without having to re-run the procedure every time you need the output sent to a different destination.
133

PROC DOCUMENT Capabilities


Transform report without rerunning the analysis or repeating the data base query Control the reports structure Display output to any other ODS Destination without having to rerun your SAS programs Manage output Store the output

134

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

67

Learning About the ODS DOCUMENT Destination and PROC DOCUMENT


http://support.sas.com/rnd/base/topics/odsdocument/

135

A Peek at PROC DOCUMENT


PDF Version at
http://sierrainformation.com/html/active/Past_PresentationsGrid.php

136

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

68

ODS Statistical Graphics


Experimental in SAS 9.1
SAS/STAT and SAS/ETS Module procedures will be able to generate statistical graphics when the ODS GRAPHICS statement is given prior to the procedure task. PROC TEMPLATE will be update to include
Experimental Graph Template Statements
Control the appearance of the graphs using PROC TEMPLATE

137

ODS Statistical Graphics


ODS Statistical Graphics
SAS/GRAPH software is not required to use the ODS Statistical Graphics features ODS Statistical Graphics can be output to multiple destinations Bob Rodriquez presentation on ODS Statistical Graphics in the SAS Demonstration Area at SUGI 28
Here is an advance look, courtesy of Bob, at a small part of his presentation

138

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

69

ODS Statistical Graphics


ods graphics on; ods html; proc robustreg RDPlot(label=outlier) HistPlot QQPlot; model GDP = LFG GAP EQP NEQ / diagnostics(all) leverage; run; ods html close; ods graphics close;
139

ODS Statistical Graphics

140

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

70

Learning More About ODS


Haworth, Lauren, Output Delivery System: The Basics SAS Publication Number 58087 The Complete Guide to the SAS Output Delivery System, Version 8 SAS Publication Number 57241 SAS Institute Tech Support Web Page and ODS FAQs Lauren Haworths web site

141

ODS Resources on the SAS Institute Web Site

SAS Institute Technical Support Resources for ODS can be found on their web site at: http://support.sas.com/rnd/base/ 142

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

71

Lauren Haworths Web Site

Lauren Haworth, author of SAS BBU texts Output Delivery System: The Basics and of PROC TABULATE By Example has placed several of her SAS user group papers on her web site. You can browse/download them from www.laurenhaworth.com/publications.htm

143

Lauren Haworths ODS Style Paper

144

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

72

Forthcoming BBU Titles about ODS


Bernadette Johnsons Instant ODS
CD/PROC TEMPLATE SAS BBU Publication

Delivery System

Sunil Gupta, Quick Results with the Output


Carpenter Series SAS BBU Publication
Just Released!

145

Thanks for Attending!

Questions? Comments?

146

Copyright 2003 Sierra Information Services, Inc. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any other means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, Sierra Information Inc. SAS is a trademark of SAS Institute in the USA and other countries. indicates USA registration. Revised 10 Jan 2003

73

You might also like