MET MA 603: SAS Programming and Applications
MET MA 603:
SAS Programming and Applications
The Output Delivery System
1
Output Deliver System
SAS procedures produce data. The Output Delivery System takes in data produced by SAS procedures and turns it into output. The ODS determines where the data is sent and how it is displayed.
The location that the output is sent is determined by the Destination, while the format and display of the data is determined by the Template.
The default Destination is HTML, while the default Template is based on the procedure that was executed. Both the Destination and the Template can be specified.
Trace, Select, and Exclude
The ODS Trace Statement instructs SAS to display information about the output objects in the Log, including the name of the output object and the template.
ODS Trace On;
Some procedures produce more than one output object. The ODS Select Statement instructs SAS to only produce the listed objects.
ODS Select freq.table1.onewayfreqs;
The ODS Exclude Statement instructs SAS to not produce the listed objects.
ODS Exclude freq.table1.onewayfreqs;
Destinations
The Destination of an output object determines the type of output that will be created.
An ODS statement can be used to direct output to a Destination (or Destinations). Specifying a path and file name will save the output in a file.
ODS PDF file = “pathname/filename.pdf”;
ODS PDF close ; ODS _all_ close ;
Destinations include:
LISTING: Text output (opens in the Output Window)
HTML: Webpage output (opens in Results Viewer)
PDF: Portable Document Format
RTF: Rich Text Format (e.g., MS Word)
OUTPUT: SAS dataset
The Output Destination
ODS can be used to direct output from Procedures into SAS datasets, for use in subsequent coding. The names of the output object and corresponding SAS dataset must be specified.
ODS Output corr.pearsoncorr = work.numbers_corr ;
Additional Options
Additional options are available to modify the output.
NoProcTitle / ProcTitle controls whether or not to print procedure titles.
ODS noproctitle ;
ODS proctitle ;
The default behavior when multiple procedures are output to a destination is to insert a page break between each new procedure. Startpage controls whether or not to insert a page break between outputs.
ODS Startpage = No ;
ODS Startpage = Yes ;
Using customer_contacts.sas7bdat, create a PDF that contains the Customer Account numbers and Landline number for all customers who have preferred contact method as Landline.
Use the Print Procedure to create the PDF, and exclude the Observation numbers from the document.
Customer List
Readings
Textbook sections (5th edition) 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7
Textbook sections (6th edition) 5.1, 5.2, 5.3, 5.4, 5.5, 5.12, 5.13
8
8
/docProps/thumbnail.jpeg