29.12.2013 Views

Base SAS 9.1.3 Procedures Guide - Acsu Buffalo

Base SAS 9.1.3 Procedures Guide - Acsu Buffalo

Base SAS 9.1.3 Procedures Guide - Acsu Buffalo

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

998 Example 13: Storing Computed Variables as Part of a Data Set 4 Chapter 43<br />

Example 13: Storing Computed Variables as Part of a Data Set<br />

Procedure features:<br />

PROC REPORT statement options:<br />

OUT=<br />

COMPUTE statement:<br />

with a computed variable as report-item<br />

DEFINE statement options:<br />

COMPUTED<br />

Other features:<br />

CHART procedure<br />

Data set: GROCERY on page 963<br />

Formats: $SCTRFMT. on page 963<br />

The report in this example<br />

3 creates a computed variable<br />

3 stores it in an output data set<br />

3 uses that data set to create a chart based on the computed variable.<br />

Program That Creates the Output Data Set<br />

Declare the PROCLIB library. The PROCLIB library is used to store user-created formats.<br />

libname proclib ’<strong>SAS</strong>-data-library’;<br />

Set the <strong>SAS</strong> system options. The NODATE option suppresses the display of the date and time<br />

in the output. PAGENO= specifies the starting page number. LINESIZE= specifies the output<br />

line length, and PAGESIZE= specifies the number of lines on an output page. FMTSEARCH=<br />

specifies the library to include when searching for user-created formats.<br />

options nodate pageno=1 linesize=64 pagesize=60<br />

fmtsearch=(proclib);<br />

Delete any existing titles.<br />

title;<br />

Specify the report options. The NOWD option runs PROC REPORT without the REPORT<br />

window and sends its output to the open output destination(s). OUT= creates the output data<br />

set PROFIT.<br />

proc report data=grocery nowd out=profit;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!