<html> <head> <!-- This file has been generated by unroff 1.0, 03/11/09 12:56:20. --> <!-- Do not edit! --> <STYLE TYPE="text/css"> <!-- A:link{text-decoration:none} A:visited{text-decoration:none} A:active{text-decoration:none} OL,UL,P,BODY,TD,TR,TH,FORM { font-family: arial,helvetica,sans-serif;; font-size:small; color: #333333; } H1 { font-size: x-large; font-family: arial,helvetica,sans-serif; } H2 { font-size: large; font-family: arial,helvetica,sans-serif; } H3 { font-size: medium; font-family: arial,helvetica,sans-serif; } H4 { font-size: small; font-family: arial,helvetica,sans-serif; } --> </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> Version 2.41 Mar2009 </small><br><a href="../doc/scripthome.html">Scripts</a> <td></tr></table> </td></tr> <td> <br> <br> <title>Manual page for proc_print(PL)</title> </head> <body> <p> <b>proc print</b> is a utility proc that doesn't draw anything. Instead, it has the following uses: <ul> <li> Print contents of script variables (but see also #write/#endwrite) <li> Print contents of data fields from data rows meeting certain <tt>select</tt> criteria (for example, outliers) <li> Count number of data rows meeting a certain <tt>select</tt> criteria (sets NSELECTED) <li> Find the data row where a certain item resides (sets FOUNDROW). This row number can then be fed to the <a href="functions.html#ploticus"> $dataitem() function </a> to access other data from the same row.<tt> </tt> </ul> <p> Result can be written to a file if <tt>outfile</tt> is specified; otherwise the result appears on the diagnostic stream (controlled by the pl <b>-diagfile</b> command line option).<tt> </tt> Because proc print turns out to have some distinct usefulness, it is no longer deprecated as of 2.41 <br><br><br> <h2>Attributes</h2> <p> <b>label</b> text <dl> <dt> <dd> 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 <tt>select</tt> and <tt>print</tt> attributes.<tt> </tt> <br><br> </dl> <p> <b>select</b> <a href="select.html"> select expression </a> <dl> <dt> <dd> Selects data records to print, using the <tt>print</tt> template.<tt> </tt> <br><br> </dl> <p> <b>print</b> text <dl> <dt> <dd> A template which may include variable and data field references.<tt> </tt> This template will be printed once for every data record that passes the selection condition.<tt> </tt> Data fields are referenced by preceding with two at-signs (@@).<tt> </tt> See example below.<tt> </tt> <dt><dd><p> This attribute may be left undefined if you are only using proc print to compute NSELECTED or FOUNDROW.<tt> </tt> <br><br> </dl> <p> <b>outfile</b> <i>filename</i> <dl> <dt> <dd> If specified, the results of proc print will be written to this file.<tt> </tt> If unspecified, results are written to the diagnostic stream (controllable using -diagfile on command line). <br><br> </dl> <p> <b>outmode</b> <tt>w | a</tt> <dl> <dt> <dd> Controls the file write mode for <tt>outfile</tt>. Default is <tt>w</tt>.<tt> </tt> 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).<tt> </tt> <br><br><br> </dl> <h2>Variables that are set by proc print</h2> <p> Note, these variables are available to the ploticus script <b>after</b> the proc completes execution. We recommend that you use #endproc to delineate the end of proc print. Also, you don't need to print anything if you're just getting these values.<tt> </tt> <p> <b>NSELECTED</b> is set to the number of records selected.<tt> </tt> This may be used, for example, to count number of records meeting a certain criteria (as given in the <tt>select</tt> statement).<tt> </tt> <p> <b>FOUNDROW</b> is set to the row number (first = 1) of the first data row to successfully match the select statement.<tt> </tt> 0 when no matches are found.<tt> </tt> This may be used (along with the <tt>select</tt> statement) to find the data row where a certain item resides. (new in 2.41) <p> <br><br><br> <h2>Example</h2> <pre> #proc print label: Outliers: select: @@3 > 300 print: @@1 @@2 had a score of @@3 #endproc #proc print label: @NSELECTED rows met the above criteria. </pre> <br> <br> </td></tr> <td align=right> <a href="../doc/welcome.html"> <img src="../doc/ploticus.gif" border=0></a><br><small>data display engine <br> <a href="../doc/Copyright.html">Copyright Steve Grubb</a> <br> <br> <center> <img src="../gallery/all.gif"> </center> </td></tr> </table> <br> <center> <table><tr><td> Ploticus is hosted at http://ploticus.sourceforge.net</td><td> </td><td> <a href="http://sourceforge.net/projects/ploticus"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=38453&type=12" width="120" height="30" border="0" alt="Get ploticus data display engine at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a> </td></tr></table> </center> <p><hr> Markup created by <em>unroff</em> 1.0, <tt> </tt> <tt> </tt>March 11, 2009. </body> </html>