## proc print | Welcome Gallery Handbook |
| Manual page for proc_print(PL)

## DESCRIPTION

proc print 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.``

Unless the `outfile` attribute is specified, information is printed to the file/stream controlled by the -diagfile command line option.``

## FEATURES

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

## VARIABLES THAT ARE SET

NSELECTED is set to the number of records selected.`` Thus proc print may be used to count number of records meeting a certain criteria.``

## PREREQUISITES

None.``

## ATTRIBUTES

label text

  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 `select` and `print` attributes.``

select conditional-expression

  conditional-expression is a conditional expression which is applied to each data record (row).`` If specified and if the expression evaluates to true, the `print` template is printed, otherwise it is not.``

print text

  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.``

outfile filename

  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.``

outmode `w` | `a`

  Controls the file write mode for `outfile`. Default is `w`.`` 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.``

## EXAMPLE

Example:

     #declare TODAY
     #set TODAY = $todaysdate()
     #proc print
     label: Outliers (run on @TODAY)
     select: @@3 > 300
     print: @@1 @@2 had a score of @@3

    data display engine

    Copyright Steve Grubb

Markup created by unroff 1.0, `` `` June 26, 2001.