HANDOUT #7 THE OUTPUT DELIVERY SYSTEM The ODS is a new version 8 method for delivering output. We will first run the following program. ODS TRACE ON; DATA ONE; INPUT X Y @@; CARDS; 1 3 2 -4 7 12 ; PROC UNIVARIATE DATA=ONE; RUN; PROC REG; MODEL Y=X; RUN; In the LOG window you will see several OUTPUT ADDED STATEMENTS. Basically these refer to different parts of the pieces making up the OUTPUT window. These can also be seen in the RESULTS window. For example, the first one refers to "univariate.moments", "univariate.x.moments", the second one refers to 'univariate measures", "univariate x.basicmeasures", etc, then several referring to the Y-variable, and then several referring to the regression output. To turn off the trace use: ODS TRACE OFF; The ODS allows us to create a sasdata set with the information contained in each of these pieces, eg To control what gets printed in the output window use the ODS LISTING command: EXCLUDE ALL -- turns off all output SELECT name1 name2 -- tells SAS to only print name1 and name2 in the output window To turn on the listing of output use : ODS LISTING; To create a sasdata set from the output use: ODS OUTPUT name=lib.name; where name refers to the trace listings. LIBNAME JIMS 'C:\'; ODS TRACE ON; ODS LISTING EXCLUDE ALL; DATA ONE; INPUT X Y @@; CARDS; 1 3 2 -4 7 12 ; PROC UNIVARIATE DATA=ONE; ODS OUTPUT MOMENTS=JIMS.A8; PROC UNIVARIATE DATA=ONE; ODS LISTING SELECT BASICMEASURES X.TESTSFORLOCATION; PROC PRINT DATA=JIMS.A8; ODS LISTING; RUN; The ODS allows us to create HTML output instead of usual output. The output will now appear in the RESULTS window as an HTML file. It will also be saved as an .HTML file using the BODY name. You need to check where SAS saves it You can also use RTF instead of HTML in which case it is saved as a word-document *.DOC In order to stop using HTML use: ODS HTML CLOSE; Same for RTF. There are ways to make the HTML output look very fancy, but we will not show any ODS LISTING CLOSE; ODS HTML BODY="A:\ODSHTM1.HTM" STYLE=BRICK; DATA ONE; INPUT X Y @@; CARDS; 1 3 2 -4 7 12 ; PROC PRINT; RUN; PROC REG; MODEL Y=X; ODS OUTPUT ANOVA=ANOVA2; ODS LISTING; PROC PRINT DATA=WORK.ANOVA2; RUN; ODS HTML CLOSE; RUN;