请问谁有SAS Statistics by Example这本书的notifydatasetchanged以及所有example中的program?

热门搜索:
当前位置:
SAS Statistics by Example
所属类别:
所属品牌:
产品简述:想了解大众对此款SAS Statistics by Example的使用评价吗?想了解大众对其供应商评价吗?SMARTER图书频道为您搜罗网络中对此款SAS Statistics by Example各方面的&&
产品简述: 想了解大众对此款SAS Statistics by Example的使用评价吗?想了解大众对其供应商评价吗?SMARTER图书频道为您搜罗网络中对此款SAS Statistics by Example各方面的评论信息,商家评论,用户评论,使用评论等。欢迎您也加入进来,留下您的评价和感受,为聪明的购物做最好的参考。&&
推荐商家:
配送方式:中国邮政平邮、中国邮政挂号信件、中国邮政特快专递(EMS)、快递公司、送货上门
最低价格:
评论标题:*
商品评分:*
&&(请针对商品质量进行打分)
详细评论:*
(还可以输入500个字)
&&&&看不清楚?
本网站为购物搜索引擎,只提供各网站商品及服务信息链接,以商家实际信息为准!
沪ICP证B2-号&沪ICP备号Fundamental Concepts for Using Base SAS Procedures : Procedure Concepts
SAS Procedures Guide
This section contains background information on concepts and tools that
are common to many base SAS procedures.
base procedures require an input SAS data set. You specify the input SAS data
set using the DATA= option in the procedure statement, for example,
proc print data=
If you omit the DATA= option, the procedure uses the value of the SAS
system option _LAST_=. The default of _LAST_= is the most recently created
SAS data set in the current SAS job or session. _LAST_= is described in detail
in SAS Language Reference: Dictionary.
to Version 7, SAS procedures that produced printed output (that is, output
that was destined for the procedure output file) generated output that was
designed for a traditional line-printer. This type of output has limitations
that prevent users from getting the most value from their results:
Traditional SAS output is limited to monospace fonts. In this
day of desktop document editors and publishing systems, users want more versatility
in printed output.
Traditional SAS output provides no way for you to parse its contents.
You cannot, for example, know in advance in what column the values for the
third variable in a report begin.
Quite a few commonly used procedures did not produce output data
sets. Users who wanted to use output from one of these procedures as input
to another procedure relied on PROC PRINTTO and the DATA step to retrieve
results that could not be stored in an output data set.
Beginning with Version 7, procedure output became much more flexible.
The Output Delivery System (ODS) has been designed to overcome the limitations
of traditional SAS output and to make it easy to make new formatting options
available to users. ODS is a method of delivering output in a variety of formats
and of making the formatted output easy to access. Important features of ODS
include the following:
ODS combines raw data with one or more table definitions to produce
one or more output objects. These objects can be sent to any or all ODS destinations.
The currently available ODS destinations can produce an output data set, traditional
monospace output,
output that is formatted for a high-resolution printer,
and output that is formatted in HyperText Markup Language (HTML).
ODS provides table definitions that define the structure of the
output from procedures and from the DATA step. You can customize the output
by modifying these definitions or by creating your own.
ODS provides a way for you to choose individual output objects
to send to ODS destinations. For instance, PROC UNIVARIATE produces five output
objects. You can easily create HTML output, an output data set, traditional
Listing output, or Printer output from any or all of these output objects.
You can send different output objects to different destinations.
ODS stores a link to each output object in the Results folder
in the Results window.
In addition, ODS removes responsibility for formatting output from individual
procedures and from the DATA step. The procedure or DATA step supplies raw
data and the name of the table definition that contains the formatting instructions,
and ODS formats the output. Because formatting is now centralized in ODS,
the addition of a new ODS destination does not affect any procedures or the
DATA step.
As future destinations are added to ODS, they will automatically
become available to all procedures that support ODS and to the DATA step.
This section briefly illustrates these features. For more information
about the Output Delivery System, see The Complete Guide to the SAS Output Delivery
Note:&&&The examples in this section use filenames that may not be valid
in all operating environments. To successfully run the example in your operating
environment, you may need to change the file specifications. See Appendix
1, "Alternate ODS HTML Statements for Running Examples in Different
Operating Environments," in The Complete Guide to the SAS Output Delivery
Creating Listing Output
do not need to change your SAS programs to create Listing output. By default,
the Listing destination is open. Unless you specifically close the Listing
destination with the ODS LISTING CLOSE statement, you will continue to create
Listing output.
Creating Printer Output
you open the Printer destination, you can create output that is formatted
for a high-resolution printer. The first ODS PRINTER statement in the following
SAS program opens the Printer destination and directs the formatted output
to the file odsprinter.ps. The second ODS PRINTER
statement closes the Printer destination. You must close the Printer destination
before you can print the file.
The data set STATEPOP is created in a
. The REGFMT. format
is created
. The printer output appears in
ods printer file='odsprinter.ps';
proc tabulate data=
var citypop_80 citypop_90;
table region*state, citypop_80*sum=' ' citypop_90*sum=' ';
format region regfmt.;
where region=1;
label citypop_80='1980' citypop_90='1990';
title 'Metropolitan Population for the Northeast Region';
title2 '(measured in millions)';
Creating HTML Output
you open the HTML destination, you can create output that is formatted in
HyperText Markup Language (HTML). You can browse these files with Internet
Explorer, Netscape, or any other browser that fully supports the HTML 3.2
The ODS HTML statement, which generates the HTML files, can create
an HTML file (called the body file) that contains the results
from the procedure
a table of contents that links to the body file
a table of pages that links to the body file
a frame that
displays the table of contents, the table of pages,
and the body file.
For example, the first ODS HTML statement in the following SAS program
generates four HTML files. ODS routes the results of the PROC UNIVARIATE step
to the body file as well as to the Listing destination. ODS also creates the
associated contents, page, and frame files. The second ODS HTML statement
closes the HTML destination. You must close the HTML destination before you
can browse the HTML files.
/* Create HTML files. */
ods html file='odshtml-body.htm'
contents='odshtml-contents.htm'
page='odshtml-page.htm'
frame='ods-html-frame.htm';
proc univariate data=statepop mu0=3.5;
var citypop_90 noncitypop_90;
/* Close the HTML destination.
/* You must close this destination before */
/* you can browse the HTML files.
Frame File Created by the ODS HTML Statement.
Select an entry in the table of contents to see the corresponding procedure
For more information about creating HTML output, see the discussion
of the ODS HTML Statement in Chapter 3, "The ODS Statements" in The Complete Guide to the SAS Output Delivery
You can see many examples of HTML output in
SAS Procedures Guide online documentation.
Note:&&&Procedure options that affect presentation may not affect HTML output.
For instance, the DOUBLE option in PROC PRINT, which inserts a blank line
between observations, has no effect on HTML output.&&
Identifying Output Objects
Several of the features of the Output Delivery System (such as
selecting and excluding output objects to send to ODS destinations or creating
a data set from an output object) require that you specify one or more particular
output objects for the system to process. You identify an output object by
its name, its label, or its path. To learn what these are,
run your SAS program
preceded by this statement:
As long as the tracing feature is on, information about each output
object that is created appears in the SAS log.
Use this statement to stop sending the information to the log:
For example, the following SAS program produces the SAS log that is
options nodate pageno=1 linesize=64 pagesize=60;
proc univariate data=statepop mu0=3.5;
var citypop_90 noncitypop_90;
options nodate pageno=1 linesize=64 pagesize=60;
proc univariate data=statepop mu0=3.5;
var citypop_90 noncitypop_90;
Output Added:
-------------
base.univariate.Moments
Univariate.CityPop_90.Moments
-------------
Output Added:
-------------
BasicMeasures
Basic Measures of Location and Variability
base.univariate.Measures
Univariate.CityPop_90.BasicMeasures
-------------
Output Added:
-------------
TestsForLocation
Tests For Location
base.univariate.Location
Univariate.CityPop_90.TestsForLocation
-------------
Output Added:
-------------
base.univariate.Quantiles
Univariate.CityPop_90.Quantiles
-------------
Output Added:
-------------
ExtremeObs
Extreme Observations
base.univariate.ExtObs
Univariate.CityPop_90.ExtremeObs
-------------Output Added:
-------------
base.univariate.Moments
Univariate.NonCityPop_90.Moments
-------------
Output Added:
-------------
BasicMeasures
Basic Measures of Location and Variability
base.univariate.Measures
Univariate.NonCityPop_90.BasicMeasures
-------------
Output Added:
-------------
TestsForLocation
Tests For Location
base.univariate.Location
Univariate.NonCityPop_90.TestsForLocation
-------------
Output Added:
-------------
base.univariate.Quantiles
Univariate.NonCityPop_90.Quantiles
-------------
Output Added:
-------------
ExtremeObs
Extreme Observations
base.univariate.ExtObs
Univariate.NonCityPop_90.ExtremeObs
-------------
Output Added:
-------------
MissingValues
Missing Values
base.univariate.Missings
Univariate.NonCityPop_90.MissingValues
-------------
If you compare this SAS log to the Results Folder that appears in
see that the string that identifies the output in the Results folder is its
For more information about the trace record, see the discussion of the
contents of the trace record in the documentation for the ODS TRACE statement
in "The ODS Statements" in The Complete Guide to the SAS Output Delivery
Selecting Output Objects to Send to ODS Destinations
Some procedures, such as PROC UNIVARIATE, produce multiple output
objects. Any procedure that uses ODS produces multiple output objects when
you use BY-group processing. ODS enables you to select which of these output
objects go to the open ODS destinations. ODS destinations include the Listing
destination, the HTML destination, the Printer destination, and the Output
destination. For more information about ODS destinations, see "Basic
Concepts about the Output Delivery System" in The Complete Guide to the SAS Output Delivery
You choose the objects to send to destinations with the ODS
the ODS EXCLUDE statement. To select individual output objects, use this form
of the ODS SELECT statement:
ODS SELECT selection(s);
where each value of selection can be
a full path,
a name, or a label (see the trace record in
). You can also use a partial
path. A partial path consists of any part of the full path that begins immediately
after a period (.) and continues to the end of the full path. For details
about referencing output objects, see the discussion of specifying an output
object in the documentation of the ODS SELECT statement in "The ODS
Statements" in The Complete Guide to the SAS Output Delivery
For example, to select just the output objects that contain the basic
measures and the quantiles from the PROC UNIVARIATE output, use the following
/* Create HTML files. */
ods html file='select-body.htm'
contents='select-contents.htm'
page='select-page.htm'
frame='select-frame.htm';
/* Select output objects by name. */
ods select BasicMeasures Q
/* Analyze the data.
proc univariate data=statepop mu0=3.5;
var citypop_90 noncitypop_90;
/* Close the HTML destination. */
The frame file appears in
The program also creates Listing output, which is not shown. The Listing output
contains the same information as the HTML body file, but it is formatted with
the traditional SAS monospace font.
The contents file shows that for each variable in the analysis, PROC
UNIVARIATE produces two output objects: one that contains basic measures and
one that contains quantiles. All four output objects are in the body file
because the ODS SELECT statement used names to identify the objects. If the
ODS SELECT statement had used paths, which are unique, it could have selected
output objects for the individual variables.
For more information about selecting output objects, see the documentation
for the ODS SELECT statement in "The ODS Statements" in The Complete Guide to the SAS Output Delivery
Creating an Output Data Set
Output Delivery System enables you to create a data set from an output object.
To create a data set,
use the ODS OUTPUT statement. In this statement,
you identify
one or more output objects from which to create a data set
the names of the data sets to create.
create a single output data set, use this simplified form
of the ODS OUTPUT statement:
ODS OUTPUT output-object=SAS-data-set;
Specify the output
object as you do in the ODS SELECT statement: with
a path, a name, a label, or a partial path. For example, to generate and print
an output data set from each output object that contains the basic measures
that PROC UNIVARIATE produces, use the following SAS program.
/* Turn off the generation of Listing output
/* because you want to create a data set, not
/* see the results.
/* Specify the data set to create. */
ods output BasicMeasures=
/* When PROC UNIVARIATE runs, ODS
/* creates a data set named MEASURES */
/* from the output object named
/* BasicMeasures.
proc univariate data=statepop mu0=3.5;
var citypop_90 noncitypop_90;
/* Open the HTML destination for PROC PRINT. */
ods html body='measures-body.htm'
contents='measures-contents.htm'
frame='measures-frame.htm';
/* Print the output data set. */
proc print data=measures noobs headings=
title 'Output Data Set Produced from';
title2 'PROC UNIVARIATE Basic Measures';
/* Reset the destinations to their defaults. */
/* Close the HTML destination.
/* Open the Listing destination.
You can use the resulting data set as input to another SAS program.
This program simply prints the data set to illustrate its structure. The HTML
output from PROC PRINT appears in
The data set contains observations for each of the variables in the
VAR statement in PROC UNIVARIATE.
For more information about creating output data sets, see the discussion
of the ODS OUTPUT statement in "The ODS Statements," in The Complete Guide to the SAS Output Delivery
Storing Links in the Results Folder
When you run a procedure
that supports ODS, SAS automatically stores a link to the ODS output in the
Results folder in the Results window. It marks
the link with an icon that identifies the output destination that created
the output.
Consider the following SAS program, which generates Listing, HTML, and
Printer output as well as an output data set (Output output). The data set
STATEPOP contains information about the distribution of the United States'
population in metropolitan and nonmetropolitan areas for 1980 and 1990. A
creates this data
options nodate pageno=1 linesize=80 pagesize=34;
ods html file='results-body.htm';
ods printer file='results.ps';
ods output basicmeasures=
proc univariate data=statepop mu0=3.5;
var citypop_90 noncitypop_90;
The Results folder (see
shows the folders and output objects that the procedure produces.
Customizing Procedure Output
Many procedures that fully
support ODS
provide table definitions
that enable you to customize each output object that the procedure produces.
You do so by creating an alternate table definition for the procedure to use.
This section illustrates how to make an alternative table definition. The
explanation here focuses on the structure of the table. For detailed explanations
of all the statements and attributes that the program uses, see the section
on the TEMPLATE procedure in
The Complete Guide to the SAS Output Delivery
For example, the following SAS program creates a customized table definition
for the BasicMeasures output object from PROC UNIVARIATE. (The trace record
provides the name of the table definition that each object uses. See
customized version
the measures of variability precede the measures of location
the column headers are modified
statistics
are displayed in a bold, italic font with a 7.3 format.
The customized output, from both the HTML and the Listing destinations, appears
. The customized Printer output
appears in
/* These four options all affect the Listing output.
/* NODATE and NONUMBER also affect the Printer output.*/
/* None of them affects the HTML output.
options nodate nonumber linesize=80 pagesize=60;
/* This PROC TEMPLATE step creates a table definition */
/* base.univariate.Measures in the SASUSER template
/* store. Table definitions that are provided
/* by SAS Institute are stored in a template
/* store in the SASHELP library. By default, ODS
/* searches for a table definition in SASUSER before
/* SASHELP, so when PROC UNIVARIATE calls for a
/* table definition by this name, ODS uses the one
/* from SASUSER.
define table base.univariate.M
notes "Basic measures of location and variability";
translate _val_ = ._ into '';
/* The HEADER statement determines the order */
/* in which the table definition uses the
/* headers, which are defined later.
header h1 h2 h3;
/* The COLUMN statement determines the order */
/* in which the variables appear. PROC
/* UNIVARIATE names the variables.
column VarMeasure VarValue LocMeasure LocV
/* These DEFINE blocks define the headers.
/* They specify the text for each header. By */
/* default, a header spans all columns, so
/* H1 does so. H2 spans the variables
/* VarMeasure and VarValue. H3 spans
/* LocMeasure and LocValue.
define h1;
text "Basic Statistical Measures";
spill_margin=
define h2;
text "Measures of Variability";
start=VarMeasure
define h3;
text "Measures of Location";
start=LocMeasure
/* These DEFINE blocks specify characteristics
/* for each of the variables. There are two
/* differences between these DEFINE blocks and
/* the ones in the table definition in SASHELP. */
/* These blocks use FORMAT= to specify a format */
/* of 7.3 for LocValue and VarValue. They also
/* use STYLE= to specify a bold, italic font
/* for these two variables. The STYLE= option
/* does not affect the Listing output.
define LocM
print_headers=
define LocV
print_headers=
format=7.3;
style=data{font_style=italic font_weight=bold};
define VarM
print_headers=
define VarV
print_headers=
format=7.3;
style=data{font_style=italic font_weight=bold};
/* End the table definition.
/* Run the procedure.
/* Begin the program that uses the
/* customized table definition.
/* The ODS HTML statement opens the HTML
/* destination and identifies the files to
/* write to.
ods html file='statepop-body.htm'
contents='statepop-contents.htm'
page='statepop-page.htm'
frame='statepop-frame.htm';
/* The ODS PRINTER statement opens the
/* Printer destination and identifies the
/* file to write to.
ods printer file='statepop.ps';
/* The ODS SELECT statement selects just the
/* output object that contains the basic measures. */
ods select BasicM
/* PROC UNIVARIATE produces one object for each
/* variable. It uses the customized table
/* definition to format the data because the
/* customized definition is in SASUSER. (See the
/* explanation with the PROC TEMPLATE statement in */
/* this example.
proc univariate data=statepop mu0=3.5;
var citypop_90 noncitypop_90;
/* Close the HTML destination.
/* Close the Printer destination. */
Customized Printer Output from PROC UNIVARIATE (page 2)
A Gallery of HTML and Printer Output Produced by Base Procedures
section illustrates the HTML and Printer output that you can get from routing
selected examples from the documentation on individual procedures through
the HTML and Printer destinations. Each piece of HTML output was created by
running the specified example with this ODS HTML statement preceding it:
ods html body='external-file';
If Printer output is shown, the specified example was run with this
ODS PRINTER statement preceding it:
ods printer file='external-file';You must execute the following statement
before you can view the resulting HTML files in a browser:
You must execute the following statement before you
can print Printer output:
PROC TABULATE: Summarizing Information with the Universal Class Variable ALL
The SAS program that produces this output is in
HTML Output from PROC TABULATE
Printer Output from PROC TABULATE
PROC FREQ: Analyzing a 2&2 Contingency Table
The SAS program that produces this output is in
HTML Output from PROC FREQ
Printer Output from PROC FREQ (page 1)
Printer Output from PROC FREQ (page 2)
PROC PRINT: Summing Numeric Variables with One BY Group
The SAS program that produces this output is in
HTML Output from PROC PRINT
PROC REPORT: Specifying Style Elements for HTML Output in the PROC REPORT Statement
The SAS program that produces this output is in
HTML Output from PROC REPORT
What Is a Style Definition?
style definition determines the overall look of the document that uses it.
Each style definition is a collection of style elements, each of which affects
a particular part of the document. Procedures may use different style elements
in different parts of their output. For example, a procedure can use one style
element for column headers and another for data. Each style element is, in
turn, a collection of attributes and values. The attributes determine the
size, face, and weight of the type that is used, the color of the foreground
and background, and other such features.
For a list of the attributes, see
SAS Institute ships a number of style definitions with the SAS System.
To see a list of these styles,
In the Results window, select the
Results folder. With your cursor
on this folder, use your right mouse button to open the Templates window.
In the Templates window, select and open
Sashelp.tmplmst.
Select Styles, and use your right
mouse button to open this folder, which contains a list of available style
definitions. If you want to view the underlying SAS code for a style definition,
select it and open it.
Operating Environment Information:&&&For information on navigating in the Explorer
window without a mouse, see the section on "Window Controls and General
Navigation" in the SAS documentation for your operating environment.&&
You can also, submit this PROC TEMPLATE step to see the SAS code for
a style definition:
source style-name;
where style-name is the path to the
style from the template store (for example styles.default
or styles.beige).
The HTML destination uses the style that is called Default unless you specify an alternative style with the
STYLE= option
in the ODS HTML statement (see the documentation for the ODS HTML statement
in The Complete Guide to the SAS Output Delivery
System). The Printer destination uses the style that is called Printer unless you specify an
alternative style with the STYLE=
option in the ODS PRINTER statement (see the documentation for the ODS PRINTER
statement in The Complete Guide to the SAS Output Delivery
In most cases, if you want to alter the style of a file that ODS produces,
you must make a copy of the style that is used, alter that copy, and store
it so that ODS will find it and use it before it finds the style that SAS
Institute provides. (For information on this process, see The Complete Guide to the SAS Output Delivery
How Do I Use Styles with Base Procedures?
A procedure uses one or more table definitions to produce output objects.
These table definitions include definitions for table elements: columns, headers,
and footers. Each table element can specify the use of one or more style elements
for various parts of the output.
However, procedures that build reports that are based on information
that the user provides do not use the same templates. Two of these procedures,
PROC REPORT and PROC TABULATE,
provide a way for you to customize the HTML
and Printer output directly from the PROC step that creates the report. Information
on how to do this is provided with the syntax for these procedures.
following list describes the style attributes that you can specify from the
TABULATE and REPORT procedures. Procedures that support the Output Delivery
System can format their output for HTML or for a high-resolution printer.
Their output is in tabular form.
Some of the style attributes apply to the
apply to individual cells in the
table. The procedure
documentation tells you which style attributes you can set from which statements
in the procedure.
Note:&&&The default value that is used for an attribute depends on the
style definition that is in use. For information on viewing the attributes
in a style, see
The implementation of an attribute depends on the ODS destination that formats
the output. In addition, if you are creating HTML output, the implementation
of an attribute depends on the browser that you use.&&Many values for style attributes are one of the following:
is a quoted character string.
is a nonnegative number, followed by one of the following
units of measure
centimeters
millimeters
a printer's point
pixels (based on the size of a pixel on the target device)
Note:&&&In Version 8 of the SAS
System, only the Printer
destination supports units of measure on dimensions. However, if you specify
CSS in the ODS HTML statement, the HTML destination supports units of measure.
The CSS option is experimental in Version 8.&&
For the HTML destination, for
the Printer destination, units of 1/150 of an inch
is a string that identifies a color. A color can be
any of the color names that are supported by SAS/GRAPH. These
names include
a predefined SAS color (for example, blue or VIYG)
a red/green/blue (RGB) value (for example,
a hue/light/saturation (HLS) value (for example, H14E162D)
a gray-scale value (for example,
An RGB value with a leading pound sign (#) rather than CX (for
example, #0023FF).
One of the colors that exists in the SAS session when the style
DMSMAGENTA
Note:&&&Use
these colors only if you are
running SAS in
the windowing environment.&&
An English-like description of an HLS value. Such descriptions
use a combination of words to describe the lightness, the saturation, and
the hue (in that order). The words that you can use are shown in the following
Saturation
orange | brown
very light
You can combine these words to form a wide variety of colors. Some examples
light vivid green
dark vivid orange
light yellow
Note:&&&The
Output Delivery system first tries to match
a color with a SAS/GRAPH color. Thus, although brown and orange are interchangeable
in the table, if you use them as
unmodified hues, they are different. The
reason for this is that ODS
treats them like SAS colors, which are mapped
to different colors.&&
You can also specify hues that are intermediate between two neighboring
colors. To do so, combine one of the following adjectives with one of its
neighboring
example, you can use the following as hues:
bluish purple (which is the same as purplish blue)
reddish orange
yellowish green
For information on SAS/GRAPH colors,
see SAS/GRAPH Software: Reference.
is a SAS format or a user-defined format.
is a reference to an attribute that is defined in the current
style or in the parent (or beyond). In this case, the value that you use is
the name of the style element followed, in parentheses, by the name of an
attribute name within that element. For example, suppose that you create a
style element called DATACELL that uses the FOREGROUND= and BACKGROUND= style
elements this way:
style datacell / background=blue
foreground=
Later, you can ensure that another style element, NEWCELL, uses the
same background color by defining it this way:
style newcell / background=datacell(background);
Similarly, suppose that you create a style element called HIGHLIGHTING
that defines three attributes this way:
style highlighting /
"go"=green
"caution"=yellow
"stop"=Later, you can define a style element called MESSAGES
that uses the colors that are defined in HIGHLIGHTING:
"note"=highlighting("go")
"warning"=highlighting("caution")
"error"=highlighting("stop");In this way, multiple style elements
could use the colors that you define in HIGHLIGHTING. If you decide to change
the value of "go" to blue, you
simply change its value in the definition of HIGHLIGHTING, and every style
element that references highlighting ("go") will use blue instead
Note:&&&In the first example, the style attribute BACKGROUND= is
a predefined style attribute. Therefore, when you reference it, you do not
put it in quotation marks. However, in the second example, "go" is a user-defined attribute. You define it
with quotation marks, and when you reference it, you must use quotation marks.
(This section describes all the predefined style attributes that are available.)&&
You can use a special form of reference to get a value for a style attribute
from the macro table at the time that the style element is used. For instance,
the following STYLE statement uses the current value of the macro variable bkgr for the background color of the style element cell:
style cell / background=symget("bkgr");
font-definition
A value can also be a font definition. A font definition
has the following general format:
("font-face-1 &... , font-face-n&",
font-size, keyword-list)
If you specify only one font face and if its name does not include
a space character, you can omit the quotation marks. If you specify more than
one font face, the browser or printer uses the first one that is installed
on your system.
font-size specifies the size of the font. font-size can be a dimension or a number without units of
measure. If you specify a dimension, you must specify a unit of measure. Without
a unit of measure, the number becomes a size that is relative to all other
font sizes in the document.
keyword-list specifies the weight, font
style, and font width. You can include one value for each, in any order. The
following table shows the keywords that you can use:
Keywords for Font Weight
Keywords for Font Style
Keywords for Font Width
COMPRESSED*
DEMI_BOLD*
EXTRA_COMPRESSED*
EXTRA_BOLD*
DEMI_LIGHT*
EXTRA_LIGHT*
*Most fonts do not honor these
Note:&&&You can use
the value _UNDEF_ for
any style attribute. ODS treats an attribute that is set to _UNDEF_ as if
its value had never been set, even in the parent or beyond.&&
In the list of style attributes that follows, any attribute that is
not documented as applying to a particular destination applies to all destinations
that support the STYLE= option in the ODS statement that opens the destination.
In Version 8 of the SAS System, the two destinations that support STYLE= are
the HTML destination and the Printer destination.
ASIS=ON|OFF
specifies how to handle leading spaces, trailing spaces,
and line breaks.
prints text with leading spaces, trailing spaces, and line
breaks as they are.
trims leading spaces and trailing spaces. OFF ignores line
Applies to:
BACKGROUND=color
specifies the color of the background.
Generally, the background color of the cell
overrides the background color of the table. You see the background color
for the table only as the space between cells (see
Applies to:
tables or cells
BACKGROUNDIMAGE='string'
specifies an image to use as the background. Viewers that
can tile the image as the background for the HTML table that the procedure
creates will do so. string is the name of a GIF or JPEG file.
You can use a simple file name, a complete path, or a URL. However, the most
versatile approach is to use a simple filename and to place all image files
in the local directory.
Applies to:
tables or cells
ODS Destinations:
BORDERCOLOR=color
specifies the color of the border if the border is just
one color.
Applies to:
tables or cells
BORDERCOLORDARK=color
specifies the darker color to use in a border that uses
two colors to create a three-dimensional effect.
Applies to:
tables or cells
ODS Destinations:
BORDERCOLORLIGHT=color
specifies the lighter color to use in a border that uses
two colors to create a three-dimensional effect.
Applies to:
tables or cells
ODS Destinations:
BORDERWIDTH=dimension
specifies the width of the border of the table.
Applies to:
Typically, when BORDERWIDTH=0, the ODS destination
sets RULES=NONE (see the discussion of
) and FRAME=VOID (see the discussion
CELLHEIGHT=dimension|integer%
specifies the height of the cell. If you specify a percent,
it represents a percentage of the height of the table. A row of cells will
have the height of the highest cell in the row.
HTML automatically sets
cell height appropriately.
You should seldom need to specify this attribute.
Applies to:
ODS Destinations:
CELLPADDING=dimension | integer%
specifies the amount of white space on each of the four
sides of the text in a cell.
Applies to:
CELLSPACING=dimension
specifies the thickness of the spacing between cells.
Applies to:
Interaction:
If BORDERWIDTH= is nonzero, and
if the background color of the cells contrasts with the background color of
the table, the color of the cell spacing is determined by the table's background.
CELLWIDTH=dimension | integer%
specifies the width of the cell. If you specify a percent,
it represents a percentage of the width of the table.
A column of cells will
have the width of the widest cell in the column.
Applies to:
The ODS destination automatically sets
cell width appropriately. You should seldom need to specify this attribute.
FLYOVER='string'
specifies the text to show in a tool tip for the cell.
Applies to:
ODS Destinations:
FONT=font-definition
specifies a font definition to use. For more information,
see the discussion of
Applies to:
FONT_FACE='string-1&... , string-n>'
specifies the font face to use. If you supply more than
one string, the browser or printer uses the first one that is installed on
your system.
You cannot be sure what fonts are available to someone who is viewing
your output in a browser or printing it on a high-resolution printer. Most
devices support
arial, helvetica.
Applies to:
FONT_SIZE=dimension | size
specifies the size of the font. The value of size is relative to all other font sizes in the document.
Applies to:
1 to 7, for size
Restriction:
If you specify a dimension, you
must specify a unit of measure. Without a unit of measure, the number becomes
a relative size.
FONT_STYLE=ITALIC
| ROMAN | SLANT
specifies the style of the font. In many cases, italic and
slant map to the same font.
Applies to:
FONT_WEIGHT=weight
specifies the font weight. weight
can be any of the following:
EXTRA_BOLD
DEMI_LIGHT
EXTRA_LIGHT
Applies to:
Restriction:
You cannot be sure what font weights
are available to someone who is viewing your
output in a browser or printing
it on a high-resolution printer. Most devices support
only MEDIUM and BOLD,
and possibly LIGHT.
FONT_WIDTH=relative-width
specifies the font width compared to the width of the usual
design. relative-width can be any of the following:
COMPRESSED
EXTRA_COMPRESSED
Applies to:
Restriction:
Most fonts do not honor these values.
FOREGROUND=color
specifies the color of the foreground, which is primarily
the color of text.
Applies to:
tables or cells
FRAME=frame-type
specifies the type of frame to use on a table. The following
table shows the possible values of frame-type
and their meanings.
This value of frame-type
Creates this kind of frame around the table
a border at the top
a border at the bottom
borders at the top, bottom, and both sides
borders at the top and bottom
a border at the left side
a border at the right side
no borders
borders at the left and right sides
Applies to:
HREFTARGET=target
specifies the window or frame in which to open the target
of the link. target can be
opens the target in a new, blank window. The window has
opens the target in the window from which the current window
was opened.
opens the target in the browser's search pane.
Restriction:
Available only in Internet Explorer
5 or later.
opens the target in the current window.
opens the target in the topmost window.
opens the target in the specified window or the frame.
Applies to:
ODS Destinations:
HTMLCLASS='string'
specifies the name of the stylesheet class to use for the
table or cell.
Applies to:
tables and cells
ODS Destinations:
HTMLID='string'
specifies an id for the table or cell. The id is for use
by a Java script.
Applies to:
tables and cells
ODS Destinations:
HTMLSTYLE='string'
specifies individual attributes and values for the table
Applies to:
tables and cells
ODS Destinations:
JUST=justification
specifies justification, where justification can be
specifies center justification.
Applies to:
tables and cells
specifies left justification.
Applies to:
tables and cells
specifies right justification.
Applies to:
tables and cells
Restriction:
Not all contexts support RIGHT.
If RIGHT is not supported, it is interpreted as CENTER.
NOBREAKSPACE=ON
specifies how to handle space characters.
does not allow SAS to break a line at a space character.
allows SAS to break a line at a space character if appropriate.
Applies to:
OUTPUTWIDTH=dimension | integer%
specifies the width of the table. If you specify a percent,
it represents a percentage of the width of the browser window.
Applies to:
Use OUTPUTWIDTH=100% to make the table as
wide as the window that it is open in.
ODS Destinations:
POSTHTML='string'
specifies the HTML code to place after the table or cell.
Applies to:
tables or cells
ODS Destinations:
POSTIMAGE='string'
specifies an image to place after the table or cell. string is the name of a GIF or JPEG file. You can use a simple filename,
a complete path, or a URL. However, the most versatile approach is to use
a simple filename and to place all image files in the local directory.
Applies to:
tables or cells
ODS Destinations:
POSTTEXT='string'
specifies text to place after the cell or table.
Applies to:
tables or cells
PREHTML='string'
specifies the HTML code to place before the table or cell.
Applies to:
tables or cells
ODS Destinations:
PREIMAGE='string'
specifies an image to place before the table or cell. string is the name of a GIF or JPEG file. You can use a simple filename,
a complete path, or a URL. However, the most versatile approach is to use
a simple filename and to place all image files in the local directory.
Applies to:
tables or cells
ODS Destinations:
PRETEXT='string'
specifies text to place before the cell or table.
Applies to:
tables or cells
PROTECTSPECIALCHARACTERS=ON | OFF | AUTO
determines how less-than signs (&), greater-than signs
(>), and ampersands (&) are interpreted. In HTML, these characters indicate
the beginning of a markup tag, the end of a markup tag, and the beginning
of the name of a file or character entity.
interprets special characters as the characters themselves.
That is, when ON is in effect the characters are protected before they are
passed to the HTML destination so that HTML does not interpret them as part
of the markup language. Using ON enables you to show HTML markup in your document.
interprets special characters as HTML code. That is, when
OFF is in effect, the characters are passed to the HTML destination without
any protection so that HTML interprets them as part of the markup language.
interprets any string that starts with a & and ends with
a > as HTML (ignoring spaces that immediately precede the &, spaces that
immediately follow the >, and spaces at the beginning and end of the string).
In any other string, AUTO protects the special characters from their HTML
Applies to:
tables or cells
ODS Destinations:
RULES=rule-type
specifies the types of rules to use in a table. The following
table shows the possible values of rule and their
This value of rule
Creates rules in these locations
between all rows and columns
between all columns
between the table header and the table and between the table and the
table footer, if there is one
no rules anywhere
between all rows
Applies to:
TAGATTR='string'
specifies text to insert in the HTML. The string must be
valid HTML for the context in which the style element is rendered. Many style
elements are rendered between &TD> and &/TD> tags. To determine how
a style element is rendered, look at the source for the output.
Applies to:
ODS Destinations:
URL='uniform-resource-locator'
specifies a URL to link to from the current cell.
Applies to:
ODS Destinations:
VJUST='justification'
specifies vertical justification, where justification can be
specifies top justification.
specifies bottom justification.
specifies center justification.
Applies to:
RUN-Group Processing
processing enables you to submit a PROC step with a RUN statement without
ending the procedure. You can continue to use the procedure without issuing
another PROC statement. To end the procedure, use a RUN CANCEL or a QUIT statement.
Several base SAS procedures support RUN-group processing:
the section on the individual procedure for more information.
Note:&&&PROC SQL executes each query automatically. Neither the RUN nor
RUN CANCEL statement has any effect.&&
processing uses a BY statement to process observations that are ordered, grouped,
or indexed according to the values of one or more variables. By default, when
you use BY-group processing in a procedure step, a BY line identifies each
group. This section explains how to create titles that serve as customized
you insert
BY-group processing information into a title, you usually want
to eliminate the default BY line. To suppress it, use the SAS system option
Note:&&&You must use the NOBYLINE option if you insert BY-group information
into titles for the following base SAS procedures:
you use the BY statement with the NOBYLINE option, these
procedures always start a new page for each BY group. This behavior prevents
multiple BY groups from appearing on a single page and ensures that the information
in the titles matches the report on the pages.&&
Inserting BY-Group Information into a Title
The general form for inserting BY-group information into a title is
#BY-specification&.suffix>
BY-specification
is one of the following:
BYVALn | BYVAL(BY-variable)
places the value of the specified BY variable in the title.
You specify the BY variable with one of the following:
is the nth BY variable in the BY statement.
BY-variable
is the name of the BY variable whose value you want to insert
in the title.
BYVARn | BYVAR(BY-variable)
places the label or the name (if no label exists) of the
specified BY variable in the title. You designate the BY variable with one
of the following:
is the nth BY variable in the BY statement.
BY-variable
is the name of the BY variable whose name you want to insert
in the title.
inserts the complete default BY line into the title.
supplies text to place immediately after the BY-group information
that you insert in the title. No space appears between the BY-group information
and the suffix.
Example: Inserting a Value from Each BY Variable into the Title
This example
creates a data set, GROC, that
contains data for stores from four
regions. Each store has four departments. This data set is created in
sorts the data by
Region and Department.
uses the SAS system option NOBYLINE to suppress the BY line that
normally appears in output that is produced with BY-group processing.
uses PROC CHART to chart sales by Region and Department. In the
first TITLE statement, #BYVAL2 inserts the value of the second BY variable,
Department, into the title. In the second TITLE statement, #BYVAL(Region)
inserts the value of Region into the title. The first period after Region
indicates that a suffix follows. The second period is the suffix.
uses the SAS system option BYLINE to return to the creation of
the default BY line with BY-group processing.
input Region $9. Manager $ Department $ S
...more lines of data...
proc sort data=
options nobyline nodate pageno=1
linesize=64 pagesize=20;
proc chart data=
vbar manager / type=sum sumvar=
title1 'This chart shows #byval2 sales';
title2 'in the #byval(region)..';
This partial output shows two BY groups with customized BY lines:
Example: Inserting the Name of a BY Variable into a Title
example inserts the name of a BY variable and the
value of a BY variable into the title. The program
uses the SAS system option NOBYLINE to suppress the BY line that
normally appears in output that is produced with BY-group processing.
uses PROC CHART to chart sales by Region. In the first TITLE statement,
#BYVAR(Region) inserts the name of the variable Region into the title. (If
Region had a label, #BYVAR would use the label instead of the name.) The suffix
al is appended to the label. In the second TITLE statement, #BYVAL1 inserts
the value of the first BY variable, Region, into the title.
uses the SAS system option BYLINE to return to the creation of
the default BY line with BY-group processing.
options nobyline nodate pageno=1
linesize=64 pagesize=20;
proc chart data=
vbar manager / type=mean sumvar=
title1 '#byvar(region).al Analysis';
title2 'for the #byval1';
This partial output shows one BY group with a customized BY line:
Example: Inserting the Complete BY Line into a Title
This example inserts the complete BY line into the title. The program
uses the SAS system option NOBYLINE to suppress the BY line that
normally appears in output that is produced with BY-group processing.
uses PROC CHART to chart sales by Region and Department. In the
TITLE statement, #BYLINE inserts the complete BY line into the title.
uses the SAS system option BYLINE to return to the creation of
the default BY line with BY-group processing.
options nobyline nodate pageno=1
linesize=64 pagesize=20;
proc chart data=
vbar manager / type=sum sumvar=
title 'Information for #byline';
This partial output shows two BY groups with customized BY lines:
Error Processing of BY-Group Specifications
The SAS System
does not issue error or warning messages
for incorrect #BYVAL, #BYVAR, or #BYLINE specifications. Instead, the text
of the item simply becomes part of the title.
statements in procedures allow multiple variable names.
You can use these shortcut notations instead of specifying each variable name:
specifies variables
X1 through
Xn. The numbers must
be consecutive.
specifies all variables that begin with the letter
specifies all variables between X and A, inclusive.
This notation
uses the position of the variables in the
x-numeric-a
specifies all numeric variables between X
and A, inclusive. This notation
uses the position of the variables in the
x-character-a
specifies all character variables between
X and A, inclusive. This
notation uses the position of the variables in the
specifies all numeric variables.
_character_
specifies all character variables.
specifies all variables.
Note:&&&You cannot use shortcuts to list
variable names
in the INDEX CREATE statement in PROC DATASETS.&&
See SAS Language Reference: Concepts for complete documentation.
Typically, when you print
or group variable values, base SAS procedures use the formatted values. This
section contains examples of how base procedures use formatted values.
Example: Printing the Formatted Values for a Data Set
The following example prints the formatted values of the data set PROCLIB.PAYROLL.
creates this data set.) In PROCLIB.PAYROLL, the variable Jobcode
indicates the job and level of the employee. For example, TA1 indicates that the employee is at the beginning level
for a ticket agent.
libname proclib 'SAS-data-library';
options nodate pageno=1
linesize=64 pagesize=40;
proc print data=proclib.payroll(obs=10)
'PROCLIB.PAYROLL';
title2 'First 10 Observations Only';
This is a partial printing of PROCLIB.PAYROLL:
The following PROC FORMAT step creates the format $JOBFMT., which assigns
descriptive names for each job:
value $jobfmt
'FA1'='Flight Attendant Trainee'
'FA2'='Junior Flight Attendant'
'FA3'='Senior Flight Attendant'
'ME1'='Mechanic Trainee'
'ME2'='Junior Mechanic'
'ME3'='Senior Mechanic'
'PT1'='Pilot Trainee'
'PT2'='Junior Pilot'
'PT3'='Senior Pilot'
'TA1'='Ticket Agent Trainee'
'TA2'='Junior Ticket Agent'
'TA3'='Senior Ticket Agent'
'NA1'='Junior Navigator'
'NA2'='Senior Navigator'
'BCK'='Baggage Checker'
'SCP'='Skycap';
The FORMAT statement in this PROC MEANS step temporarily associates
the $JOBFMT. format with the variable Jobcode:
options nodate pageno=1
linesize=64 pagesize=60;
proc means data=proclib.
format jobcode $jobfmt.;
title 'Summary Statistics for';
title2 'Each Job Code';
PROC MEANS produces this output, which uses the $JOBFMT. format:
Note:&&&Because formats are character strings, formats for numeric variables
are ignored when the values of the numeric variables are needed for mathematical
calculations.&&
Example: Grouping or Classifying Formatted Data
value $codefmt
'FA1','FA2','FA3'='Flight Attendant'
'ME1','ME2','ME3'='Mechanic'
'PT1','PT2','PT3'='Pilot'
'TA1','TA2','TA3'='Ticket Agent'
'NA1','NA2'='Navigator'
'BCK'='Baggage Checker'
'SCP'='Skycap';
options nodate pageno=1
linesize=64 pagesize=40;
proc means data=proclib.
format jobcode $codefmt.;
title 'Summary Statistics for Job Codes';
title2 '(Using a Format that Groups the Job Codes)';
PROC MEANS produces this output:
Example: Temporarily Associating a Format with a Variable
you want to associate a format with a variable temporarily, you can use the
FORMAT statement. For example, the following PROC PRINT step associates the
DOLLAR8. format with the variable Salary for the duration of this PROC PRINT
step only:
options nodate pageno=1
linesize=64 pagesize=40;
proc print data=proclib.payroll(obs=10)
format salary dollar8.;
title 'Temporarily Associating a Format';
title2 'with the Variable Salary';
PROC PRINT produces this output:
a variable has a permanent format that you do not want a procedure to use,
temporarily dissociate the format from the variable using a FORMAT statement.
In this example, the FORMAT statement in the DATA step permanently associates
the $YRFMT. variable with the variable Year. Thus, when you use the variable
in a PROC step, the procedure uses the formatted values. The
PROC MEANS step,
however, contains a FORMAT statement that dissociates the $YRFMT. format from
Year for this PROC MEANS step only. PROC MEANS uses the stored value for Year
in the output.
value $yrfmt
'1'='Freshman'
'2'='Sophomore'
'3'='Junior'
'4'='Senior';
input Name $ Gender $
format year $yrfmt.;
Capiccio m 1 3.598 Tucker
f 2 3.722 Berry
m 2 3.342 Gold
f 3 3.177 Syme
Baglione f 4 4.000 Carr
m 4 3.574 Lewis
options nodate pageno=1
linesize=64 pagesize=40;
proc means data=debate mean maxdec=2;
title 'Average GPA';
PROC MEANS produces this output, which does not use the YRFMT. format:
Formats and BY-Group Processing
a procedure processes a data set, it checks to see if a format is assigned
to the BY variable. If so, the procedure adds observations to the current
BY groups until the formatted value changes. If nonconsecutive
internal values of the BY variable(s) have the same formatted value, the values
are grouped into different BY groups. This results in two BY groups with the
same formatted value. Further, if different and consecutive internal
values of the BY variable(s) have the same formatted value, they are included
in the same BY group.
Formats and Error Checking
cannot find a format, it stops processing and prints an error message in the
SAS log. You can suppress this behavior with the SAS system option NOFMTERR.
When you use NOFMTERR, and SAS cannot find the format, SAS uses a default
format and continues to process. Typically, for the default, SAS uses the
BESTw. format for numeric variables and the $w.
format for character variables.
Note:&&&To ensure that SAS can find user-written formats, use the SAS
system option FMTSEARCH=. How to store formats is described in
Processing All the Data Sets in a Library
You can use the SAS Macro Facility to run the same procedure
on every data set in a library. The macro facility is part of base SAS software.
shows how to print all
the data sets in a library. You can use the same macro
definition to perform any procedure on all the data sets in a library. Simply
replace the PROC PRINT piece of the program with the appropriate procedure
Operating Environment-Specific Procedures
Several base SAS
procedures are specific to one operating
environment or one release.
a table with additional information. These procedures are described in more
detail in the SAS documentation for operating environments.
Statistic Descriptions
identifies common descriptive
statistics that are available in several base procedures. See
for more detailed information about available statistics
and theoretical information.
Description
Procedures
confidence intervals
FREQ, MEANS, UNIVARIATE
corrected sum of squares
CORR, MEANS/SUMMARY, REPORT, SQL, TABULATE, UNIVARIATE
coefficient of variation
MEANS/SUMMARY, REPORT, SQL, TABULATE, UNIVARIATE
goodness-of-fit tests
FREQ, UNIVARIATE
MEANS/SUMMARY, UNIVARIATE
largest (maximum) value
CORR, MEANS/SUMMARY, REPORT, SQL, TABULATE, UNIVARIATE
CORR, MEANS/SUMMARY, REPORT, SQL, TABULATE, UNIVARIATE
median (50th percentile)
CORR (for nonparametric correlation measures), MEANS/SUMMARY, TABULATE,
UNIVARIATE
smallest (minimum) value
CORR, MEANS/SUMMARY, REPORT, SQL, TABULATE, UNIVARIATE
most frequent value (if not unique, the smallest mode is used)
UNIVARIATE
number of observations on which calculations are based
CORR, FREQ, MEANS/SUMMARY, REPORT, SQL, TABULATE, UNIVARIATE
number of missing values
FREQ, MEANS/SUMMARY, REPORT, SQL, TABULATE, UNIVARIATE
number of observations
MEANS/SUMMARY, UNIVARIATE
the percentage of a cell or row frequency to a total frequency
REPORT, TABULATE
the percentage of a cell or row sum to a total sum
REPORT, TABULATE
Pearson correlation
percentiles
FREQ, MEANS/SUMMARY, TABULATE, UNIVARIATE
CORR, MEANS/SUMMARY, REPORT, SQL, TABULATE, UNIVARIATE
robust statistics
trimmed means, Winsorized means
UNIVARIATE
MEANS/SUMMARY, UNIVARIATE
Spearman correlation
standard deviation
CORR, MEANS/SUMMARY, REPORT, SQL, TABULATE, UNIVARIATE
the standard error of the mean
MEANS/SUMMARY, REPORT, SQL, TABULATE, UNIVARIATE
CORR, MEANS/SUMMARY, REPORT, SQL, TABULATE, UNIVARIATE
sum of weights
CORR, MEANS/SUMMARY, REPORT, SQL, TABULATE, UNIVARIATE
tests of location
UNIVARIATE
uncorrected sum of squares
CORR, MEANS/SUMMARY, REPORT, SQL, TABULATE, UNIVARIATE
CORR, MEANS/SUMMARY, REPORT, SQL, TABULATE, UNIVARIATE
Computational Requirements for Statistics
The following
requirements are computational requirements for
the statistics that are listed in
They do not describe recommended sample sizes.
N and NMISS do not require any nonmissing observations.
SUM, MEAN, MAX, MIN, RANGE,
USS, and CSS require at least one
nonmissing observation.
VAR, STD, STDERR, and CV require at least two observations.
CV requires that MEAN is not equal to
Statistics are reported as missing if they cannot be computed.

我要回帖

更多关于 c dataset用法 的文章

 

随机推荐