Hello, I would like to cleanup a report I am creating using proc report. I have data similar to:
data have;
infile datalines dlm=',';
input order group :$20. year month value;
datalines;
1,group 1,2019,7,10
1,group 1,2019,8,10
1,group 1,2019,9,15
1,group 1,2019,10,100
1,group 1,2019,11,100
1,group 1,2019,12,500
1,group 1,2020,1,1000
2,group 2,2019,7,10
2,group 2,2019,8,10
2,group 2,2019,9,10
2,group 2,2019,10,12
2,group 2,2019,11,100
2,group 2,2019,12,250
2,group 2,2020,1,300
3,group 3,2019,9,5
3,group 3,2019,10,5
3,group 3,2019,11,5
3,group 3,2019,12,7
3,group 3,2020,1,100
4,group 3 / group 2,2019,9,0.50
4,group 3 / group 2,2019,10,0.42
4,group 3 / group 2,2019,11,0.05
4,group 3 / group 2,2019,12,0.03
4,group 3 / group 2,2020,1,0.3
;
run;
I want to report by group (in order of the order variable) with month and year going across. This is what I have so far:
proc report data = have nowd;
columns order group year,month,value;
define order / noprint;
define group / group ;
define year / across ;
define month / across ;
define value / analysis ;
run;
In my output I have five header rows
'year'
year value
'month'
month value
'value
Is it possible to supress the rows that say 'year','month' and 'value (1,3 and 5)?
Also, the report is producing columns that I don't have in my data. For example the year month combination of year 2020 and month 7. Is it possible to suppress these columns that I don't have data for?
I included an image to further explain.
Ultimately I want to put this in excel.
... View more