I create a report using the PROC REPORT facility, and this is how my code looks :-
PROC REPORT DATA=MERGED NOCENTER NOWD HEADLINE HEADSKIP MISSING;
COLUMN SDC SDCDESC N SHEETCT;
DEFINE SDC / GROUP FORMAT=£4. 'SDC';
DEFINE SDCDESC / GROUP FORMAT=£40. 'PRODUCT DESCRIPTION';
DEFINE SHEETCT / ANALYSIS SUM FORMAT=7. 'SHEET COUNT';
LINE "TOTAL MPKT COUNT : "
LINE "TOTAL SHEET COUNT: "
I execute this in the mainframe, using a batch job written in JCL. And when I complete running this job, I am able to see the report in SASLIST (similar to sysout). Now I want the o/p of PROC REPORT to be moved into a dataset.
Can someone please let me know how I can do that !
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:
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_
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.
proc report data=sashelp.shoes nowd
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';
rbreak after / summarize;
region = 'Total';