Hi:
PROC REPORT supports an OUT= option like this:
[pre]
PROC REPORT DATA=MERGED NOCENTER NOWD
HEADLINE HEADSKIP MISSING OUT=work.reptout;
PROC REPORT DATA=MERGED NOCENTER NOWD
HEADLINE HEADSKIP MISSING OUT=permlib.reptout;
[/pre]
Of course, options like HEADLINE/HEADSKIP have no effect the output dataset. In addition, output from LINE statements is not put into the dataset. You will also notice an extra variable is added to the output dataset. This variable is named _BREAK_ and if you have BREAK or RBREAK statements in your code, you will see output that looks like this:
[pre]
Obs Region Product Sales _BREAK_
1 Asia Boot $62,708
2 Asia Men's Casual $11,754
3 Asia Men's Dress $119,366
4 Asia Sandal $8,208
5 Asia Slipper $152,032
6 Asia Sport Shoe $2,092
7 Asia Women's Casual $25,837
8 Asia Women's Dress $78,234
9 Asia Total $460,231 Region
10 Canada Boot $385,613
11 Canada Men's Casual $441,903
12 Canada Men's Dress $920,101
13 Canada Sandal $14,798
14 Canada Slipper $952,751
15 Canada Sport Shoe $140,389
16 Canada Women's Casual $410,807
17 Canada Women's Dress $989,350
18 Canada Total $4,255,712 Region
19 Total $4,715,943 _RBREAK_
[/pre]
This output was created with the program shown below.
You cannot currently use the OUT= option with a PROC REPORT that uses a BY statement.
cynthia
[pre]
ods listing;
proc report data=sashelp.shoes nowd
out=work.reptout;
where region in ('Asia', 'Canada');
column region product sales;
define region / group;
define product /group;
define sales /sum;
break after region /summarize skip;
compute after region;
region = trim(region)||' Total';
endcomp;
rbreak after / summarize;
compute after;
region = 'Total';
endcomp;
run;
options nocenter nodate nonumber;
proc print data=work.reptout;
run;
[/pre]