Previous Page | Next Page

The PRINTTO Procedure

Example 1: Routing to External Files


Procedure features:

PRINTTO statement:

Without options

Options:

LOG=

NEW

PRINT=


This example uses PROC PRINTTO to route the log and procedure output to an external file and then reset both destinations to the default.


Program

 Note about code
options nodate pageno=1 linesize=80 pagesize=60 source;
 Note about code
proc printto log='log-file';
   run;
 Note about code
data numbers;
   input x y z;
   datalines;
 14.2   25.2   96.8
 10.8   51.6   96.8
  9.5   34.2  138.2
  8.8   27.6   83.2
 11.5   49.4  287.0
  6.3   42.0  170.7
;
 Note about code
proc printto print='output-file' new;
run;
 Note about code
proc print data=numbers;
   title 'Listing of NUMBERS Data Set';
run;
 Note about code
proc printto;
run;

Log

Portion of Log Routed to the Default Destination

01   options nodate pageno=1 linesize=80 pagesize=60 source;
02   
03   proc printto log='log-file';
04   run;

NOTE: PROCEDURE PRINTTO used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds

Portion of Log Routed to an External File

  NOTE: PROCEDURE PRINTTO used (Total process time):
        real time           0.01 seconds
        cpu time            0.01 seconds


  5
  6      data numbers;
  7       input x y z;
  8       datalines;

  NOTE: The data set WORK.NUMBERS has 6 observations and 3 variables.
  NOTE: DATA statement used (Total process time):
        real time           0.06 seconds
        cpu time            0.04 seconds


  15   ;
  16
  17     proc printto print='output-log' new;
  18   run;

  NOTE: PROCEDURE PRINTTO used (Total process time):
        real time           0.00 seconds
        cpu time            0.00 seconds


  19
  20     proc print data=numbers;
  21      title 'Listing of NUMBERS Data Set';
  22   run;

  NOTE: There were 6 observations read from the data set WORK.NUMBERS.
  NOTE: The PROCEDURE PRINT printed page 1.
  NOTE: PROCEDURE PRINT used (Total process time):
        real time           0.26 seconds
        cpu time            0.07 seconds


  23
  24     proc printto;
  25   run;

Output

Procedure Output Routed to an External File

                          Listing of NUMBERS Data Set                          1

                          OBS      x       y       z

                           1     14.2    25.2     96.8
                           2     10.8    51.6     96.8
                           3      9.5    34.2    138.2
                           4      8.8    27.6     83.2
                           5     11.5    49.4    287.0
                           6      6.3    42.0    170.7

Previous Page | Next Page | Top of Page