This example
uses PROC PRINTTO to route the log and procedure output
to an external file and then reset both destinations to the default.
|
options nodate pageno=1 linesize=80 pagesize=60 source; |
|
proc printto log='log-file';
run; |
|
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
; |
|
proc printto print='output-file' new;
run; |
|
proc print data=numbers;
title 'Listing of NUMBERS Data Set';
run; |
|
proc printto;
run; |
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;
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
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.