You can achieve this quite easily in 2 passthroughs if you use a view for the variable renaming.
1 Proc Transpose
Transpose the data first in order to have only 4 columns:
- The ID (id)
- The model (model)
- The label_year combination (NAME)
- The value (COL1)
Note that i used an IF statement to eliminate all OLD models, since i did not see them in your desired output.
proc transpose data=DATAINPUT out=TRANSPOSEOUTPUT;
where MODEL='NEW';
by id model;
run;
2 Data Step View
Here we basically split NAME into label and year. In addition, some cleaning of the data (dropping NAME & renaming COL1)
data V_TRANSPOSEOUTPUT (drop=_NAME_ rename=(COL1=value)) /view=V_TRANSPOSEOUTPUT;
length ID 8;
length model $3;
length year 8;
length label $1;
set TRANSPOSEOUTPUT;
label=scan(_NAME_,1,'_');
year=scan(_NAME_,2,'_');
run;
3 Proc Tabulate (instead of proc report)
I found proc tabulate more appropriate than proc report because - at least in my opninion - it is easier to construct a crosstab. At least, from your comments i derive you want to present the desired output as a report, not as a dataset.
proc tabulate data=V_TRANSPOSEOUTPUT;
table id*model*year,label*value;
class id model year year label;
var value;
run;
I tested this and my output is slightly different from what you wrote, but i suspect that you made a couple of mistakes when writing out the results you desire. ;)