.ig >>
<STYLE TYPE="text/css">
<!--
        A:link{text-decoration:none}
        A:visited{text-decoration:none}
        A:active{text-decoration:none}
-->
</STYLE>
<title>ploticus: proc print</title>
<body bgcolor=D0D0EE vlink=0000FF>
<br>
<br>
<center>
<table cellpadding=2 bgcolor=FFFFFF width=550 ><tr>
<td>
  <table cellpadding=2 width=550><tr>
  <td><br><h2>proc print</h2></td>
  <td align=right>
  <small>
  <a href="../doc/Welcome.html"><img src="../doc/ploticus.gif" border=0></a><br>
  <a href="../doc/Welcome.html">Welcome</a> &nbsp; &nbsp;
  <a href="../gallery/index.html">Gallery</a> &nbsp; &nbsp;
  <a href="../doc/Contents.html">Handbook</a> 
  <td></tr></table>
</td></tr>
<td>
<br>
<br>
.>>

.TH proc_print PL "26-JUN-2001   PL www.sgpr.net"

.SH DESCRIPTION
\fBproc print\fR may be used to print messages and debugging info.
It can print the contents of variables and/or
data fields to a file or to standard error.
It is mainly useful for displaying or exporting information
pertaining to outlier cases and for debugging a script.
.LP
Unless the \fCoutfile\fR attribute is specified, information is
printed to the file/stream controlled by the \fB-diagfile\fR
command line option.

.SH FEATURES
Cases may be selected using a conditional expression,
for purposes such as identifying outliers.

.SH VARIABLES THAT ARE SET
\fBNSELECTED\fR is set to the number of records selected.
Thus proc print may be used to count number of records meeting a certain criteria.

.SH PREREQUISITES
None.

.SH ATTRIBUTES
.LP
\fBlabel\fR 
.ig >>
<a href="attributetypes.html#text">
.>>
\fI text \fR
.ig >>
</a>
.>>
.IP
Arbitrary text that will be printed once.  May include
@variable references using one at-sign (@).  Typically
used to examine contents of variables or to print a header
for the cases listed by the \fCselect\fR and \fCprint\fR attributes.

.LP
\fBselect\fR 
.ig >>
<a href="condex.html">
.>>
\fI conditional-expression \fR
.ig >>
</a>
.>>
.IP
\fIconditional-expression\fR is a conditional expression which
is applied to each data record (row).
If specified and if the expression evaluates to true, 
the \fCprint\fR template is printed,
otherwise it is not.

.LP
\fBprint\fR 
.ig >>
<a href="attributetypes.html#text">
.>>
\fI text \fR
.ig >>
</a>
.>>
.IP
A template which may include variable and data field references.
This template will be printed once for every data record
that passes the selection condition.
Data fields are referenced by preceding with two at-signs (@@).
See example below.

.LP
\fBoutfile\fR \fIfilename\fR
.IP
If specified, the results of proc print will be written to this file.
If unspecified, results are written to the diagnostic stream (controllable
using -diagfile on command line).  New in version 1.40.

.LP
\fBoutmode\fR  \fCw\fR | \fCa\fR
.IP
Controls the file write mode for \fCoutfile\fR.  Default is \fCw\fR.
w = write (create new file / erase
any current contents); a = append (append to any existing contents; if none then
create new file).  See also fopen(2).  New in version 1.40.


.SH EXAMPLE
Example:
.nf
.ft C
\0#declare TODAY
\0#set TODAY = $todaysdate()
\0#proc print
\0label: Outliers (run on @TODAY)
\0select: @@3 > 300
\0print: @@1 @@2 had a score of @@3

.ig >>
<br>
<br>
</td></tr>
<td align=right>
<a href="Welcome.html">
<img src="../doc/ploticus.gif" border=0></a><br><small>data display engine &nbsp; <br>
<a href="Copyright.html">Copyright Steve Grubb</a>
<br>
<br>
<center>
<img src="../gallery/all.gif">
</center>
</td></tr>
</table>
.>>
