Hi,
I have a matrix like this. The number of SP can be more than 2 next time. So its value is stored in a macro variable &nosp. Number of MP is stored in &nomp. Number of SSP is stored in &nossp.
MP_SP_SSP SP1 SP2 Mean SP1 SP2 Mean SP1 SP2 Mean
SSP1 24.00 24.50 24.25 39.70 34.40 37.05 27.30 27.60 27.45
SSP2 31.50 24.50 28.00 35.60 34.30 34.95 32.90 27.60 30.25
Mean 27.75 24.50 26.13 37.65 34.35 36.00 30.10 27.60 28.85
I want the output like this. SP1 and SP2 are bifurcated under MP1. Next SP1 and SP2 bifurfacted under MP2 and similarly for next.
MP1 MP2 MP3
MP_SP_SSP SP1 SP2 Mean SP1 SP2 Mean SP1 SP2 Mean
SSP1 24.00 24.50 24.25 39.70 34.40 37.05 27.30 27.60 27.45
SSP2 31.50 24.50 28.00 35.60 34.30 34.95 32.90 27.60 30.25
Mean 27.75 24.50 26.13 37.65 34.35 36.00 30.10 27.60 28.85
Please take me out of it.
The values are stored in columns COLUMN1-COLUMN9. COLUMN3, COLUMN6 & COLUMN9 has label as Mean.
I am trying a code something like this but with lots of errrors.
[pre]
Proc Report Data=new3way Nowd style(header)=[TEXTALIGN=C] headline headskip spacing=1;
Column ('_' &main._&sub._&subsub %Do jj=1 %To &nomp;
('MP&jj' COLUMN_1-COLUMN_&nosp)
%End;
COLUMN_%eval(&nomp*&nomp));
Define &main._&sub._&subsub/Display;
%Do jj=1 %To %eval(&nomp*&nomp);
COLUMN_&jj/Display;
%End;
Run;
[/pre]