📄 m04 - creating list reports - 53 of 55.mht
字号:
option.';"=20
onclick=3DsuggestBack() onmouseout=3D"window.status=3D''"=20
=
href=3D"http://www.sas.com/apps/OLTRN/59080/m4/m4_8.htm#noobs">NOOBS=20
option</A> in the PROC PRINT statement. As an alternative, you can =
replace=20
the <CODE>Obs</CODE> column with one or more variables by using =
the <A=20
onmouseover=3D"window.status=3D'Display details on the ID =
statement.';"=20
onclick=3DsuggestBack() onmouseout=3D"window.status=3D''"=20
href=3D"http://www.sas.com/apps/OLTRN/59080/m4/m4_9.htm">ID =
statement</A>.=20
<P><STRONG>Selecting Observations</STRONG><BR>The <A=20
onmouseover=3D"window.status=3D'Display details on the WHERE =
statement.';"=20
onclick=3DsuggestBack() onmouseout=3D"window.status=3D''"=20
href=3D"http://www.sas.com/apps/OLTRN/59080/m4/m4_11.htm">WHERE=20
statement</A> enables you to select observations that meet a =
particular=20
condition in the SAS data set. You use <A=20
onmouseover=3D"window.status=3D'Display details on comparison =
operators.';"=20
onclick=3DsuggestBack() onmouseout=3D"window.status=3D''"=20
=
href=3D"http://www.sas.com/apps/OLTRN/59080/m4/m4_11.htm#compoper">compar=
ison=20
operators</A> to express a condition in the WHERE statement. To =
specify a=20
condition based on the value of a character variable, you must =
enclose the=20
value in quotation marks, and you must write the value with lower =
and=20
uppercase letters exactly as it appears in the data set. You can =
also use=20
WHERE statements to select a subset of observations based on =
multiple=20
conditions. To link a sequence of expressions into compound =
expressions,=20
you use <A=20
onmouseover=3D"window.status=3D'Display details on logical =
operators.';"=20
onclick=3DsuggestBack() onmouseout=3D"window.status=3D''"=20
=
href=3D"http://www.sas.com/apps/OLTRN/59080/m4/m4_13.htm#logoper">logical=
=20
operators</A>. When you test for multiple values of the same =
variable, you=20
specify the variable name in each expression. You can use the <A=20
onmouseover=3D"window.status=3D'Display details on the IN =
operator.';"=20
onclick=3DsuggestBack() onmouseout=3D"window.status=3D''"=20
=
href=3D"http://www.sas.com/apps/OLTRN/59080/m4/m4_13.htm#inoper">IN=20
operator</A> as a convenient alternative. To control how compound=20
expressions are evaluated, you can use <A=20
onmouseover=3D"window.status=3D'Display details on using =
parentheses.';"=20
onclick=3DsuggestBack() onmouseout=3D"window.status=3D''"=20
=
href=3D"http://www.sas.com/apps/OLTRN/59080/m4/m4_13.htm#parens">parenthe=
ses</A>.=20
<P><STRONG>Sorting Data</STRONG><BR>To display your data in sorted =
order,=20
you use <A=20
onmouseover=3D"window.status=3D'Display details on the PROC SORT =
statement.';"=20
onclick=3DsuggestBack() onmouseout=3D"window.status=3D''"=20
href=3D"http://www.sas.com/apps/OLTRN/59080/m4/m4_16.htm">PROC =
SORT</A> to=20
sort your data before using PROC PRINT to create reports. By =
default, PROC=20
SORT sorts the data set specified in the DATA=3D option =
permanently. If you=20
do not want your data to be sorted permanently, you must create an =
output=20
data set that contains the data in sorted order. The OUT=3D =
option in=20
the PROC SORT statement specifies an output data set. If you need =
sorted=20
data to produce output for only one SAS session, you should =
specify a=20
temporary SAS data set as the output data set. The BY statement, =
which is=20
required with PROC SORT, specifies the variable(s) whose values =
are used=20
to sort the data.=20
<P><STRONG>Generating Column Totals</STRONG><BR>To total the =
values of=20
numeric variables, use the <A=20
onmouseover=3D"window.status=3D'Display details on the SUM =
statement.';"=20
onclick=3DsuggestBack() onmouseout=3D"window.status=3D''"=20
href=3D"http://www.sas.com/apps/OLTRN/59080/m4/m4_20.htm">SUM =
statement</A>=20
in the PROC PRINT step. You do not need to specify the variables =
in a VAR=20
statement if you specify them in the SUM statement. Column totals =
appear=20
at the end of the report in the same format as the values of the=20
variables. To produce subtotals, add both the SUM statement and =
the <A=20
onmouseover=3D"window.status=3D'Display details on the BY =
statement.';"=20
onclick=3DsuggestBack() onmouseout=3D"window.status=3D''"=20
href=3D"http://www.sas.com/apps/OLTRN/59080/m4/m4_23.htm">BY =
statement</A>=20
to your PROC PRINT step. To show <A=20
onmouseover=3D"window.status=3D'Display details on customized =
layouts.';"=20
onclick=3DsuggestBack() onmouseout=3D"window.status=3D''"=20
href=3D"http://www.sas.com/apps/OLTRN/59080/m4/m4_25.htm">BY =
variable=20
headings</A> only once, use an ID and BY statement together with =
the SUM=20
statement. As another enhancement to your report, you can request =
that=20
each BY group be printed on a separate page by using the <A=20
onmouseover=3D"window.status=3D'Display details on the PAGEBY =
statement.';"=20
onclick=3DsuggestBack() onmouseout=3D"window.status=3D''"=20
href=3D"http://www.sas.com/apps/OLTRN/59080/m4/m4_27.htm">PAGEBY=20
statement</A>.=20
<P><STRONG>Double Spacing Output</STRONG><BR>To double space your =
SAS=20
listing output, you can specify the <A=20
onmouseover=3D"window.status=3D'Display details on the DOUBLE =
option.'; "=20
onclick=3DsuggestBack() onmouseout=3D"window.status=3D''"=20
href=3D"http://www.sas.com/apps/OLTRN/59080/m4/m4_30.htm">DOUBLE =
option</A>.=20
<P><STRONG>Specifying Titles</STRONG><BR>To make your report more=20
meaningful and self-explanatory, you can associate up to 10 titles =
with=20
procedure output by using <A=20
onmouseover=3D"window.status=3D'Display details on the TITLE =
statement.';"=20
onclick=3DsuggestBack() onmouseout=3D"window.status=3D''"=20
href=3D"http://www.sas.com/apps/OLTRN/59080/m4/m4_32.htm">TITLE=20
statements</A> anywhere within or preceding the PROC step. After =
you=20
define a title, it remains in effect until you modify it, cancel =
it, or=20
end your SAS session. Redefining a title line cancels any =
higher-numbered=20
title lines. To cancel all previous titles, specify a null TITLE =
statement=20
(a TITLE statement with no number or text).=20
<P><STRONG>Specifying Footnotes</STRONG><BR>To add footnotes to =
your=20
output, you can use the <A=20
onmouseover=3D"window.status=3D'Display details on the FOOTNOTE =
statement.';"=20
onclick=3DsuggestBack() onmouseout=3D"window.status=3D''"=20
href=3D"http://www.sas.com/apps/OLTRN/59080/m4/m4_32.htm">FOOTNOTE =
statement</A>. Like TITLE statements, FOOTNOTE statements are =
global.=20
Footnotes appear at the bottom of each page of procedure output, =
and=20
footnote lines are "pushed up" from the bottom. The FOOTNOTE =
statement=20
that has the largest number appears on the bottom line. After you =
define a=20
footnote, it remains in effect until you modify it, cancel it, or =
end your=20
SAS session. Redefining a footnote line cancels any =
higher-numbered=20
footnote lines. To cancel all previous footnotes, specify a null =
FOOTNOTE=20
statement (a FOOTNOTE statement with no number or text).
<SCRIPT>writeInterface(docInfo1);</SCRIPT>
=20
<P><STRONG>Assigning Descriptive Labels</STRONG><BR>To label the =
columns=20
in your report with more descriptive text, you use the <A=20
onmouseover=3D"window.status=3D'Display details on the LABEL =
statement.';"=20
onclick=3DsuggestBack() onmouseout=3D"window.status=3D''"=20
href=3D"http://www.sas.com/apps/OLTRN/59080/m4/m4_41.htm">LABEL=20
statement</A>, which assigns a descriptive label to a variable. To =
display=20
the labels that were assigned in a LABEL statement, you must =
specify the=20
LABEL option in the PROC PRINT statement.=20
<P><STRONG>Formatting Data Values</STRONG><BR>To make data values =
more=20
understandable when they are displayed in your procedure output, =
you can=20
use the <A=20
onmouseover=3D"window.status=3D'Display details on the FORMAT =
statement.';"=20
onclick=3DsuggestBack() onmouseout=3D"window.status=3D''"=20
href=3D"http://www.sas.com/apps/OLTRN/59080/m4/m4_45.htm">FORMAT=20
statement</A>, which associates formats with variables. The FORMAT =
statement remains in effect only for the PROC step in which it =
appears.=20
Formats affect only how the data values appear in output, not the =
actual=20
data values as they are stored in the SAS data set. All SAS =
formats=20
specify the total <A=20
onmouseover=3D"window.status=3D'Display details on format =
widths.';"=20
onclick=3DsuggestBack() onmouseout=3D"window.status=3D''"=20
href=3D"http://www.sas.com/apps/OLTRN/59080/m4/m4_47.htm">field =
width</A>=20
(<EM>w</EM>) that is used for displaying the values in the output. =
For=20
numeric variables you can also specify the number of decimal =
places=20
(<EM>d</EM>), if any, to be displayed in the output.=20
<P><STRONG>Using Permanently Assigned Labels and =
Formats</STRONG><BR>You=20
can take advantage of <A=20
onmouseover=3D"window.status=3D'Display details on the FORMAT =
statement.';"=20
onclick=3DsuggestBack() onmouseout=3D"window.status=3D'';"=20
=
href=3D"http://www.sas.com/apps/OLTRN/59080/m4/m4_51.htm">permanently</A>=
=20
assigned labels or formats without adding LABEL or FORMAT =
statements to=20
your PROC step. </P></TD></TR></TBODY></TABLE><!-- =
InstanceEndEditable --><BR>
<TABLE cellSpacing=3D0 cellPadding=3D0 width=3D"85%" align=3Dcenter =
border=3D0>
<TBODY>
<TR>
<TD align=3Dleft>
<HR>
</TD></TR></TBODY></TABLE>
<P><!-- InstanceBeginEditable name=3D"syntax" -->
<CENTER>
<TABLE cellSpacing=3D0 cellPadding=3D0 width=3D"85%" border=3D0>
<TBODY>
<TR>
<TD><STRONG><A name=3DSyntax>Syntax</A></STRONG>=20
<P><EM>To go to the page where a statement or option was =
presented, select=20
a link.</EM>=20
<BLOCKQUOTE>
<DL>
<DT><FONT color=3D#003399><STRONG>LIBNAME</STRONG> =
<EM>libref</EM>=20
=
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -