XYZ | Xyz Count | 68 | 169 | 88 |
---|---|---|---|---|
Other Pct | 51.9 | 62.4 | 56.1 | |
Others | Xyz Count | 63 | 102 | 69 |
Other Pct | 48.1 | 37.6 | 43.9 |
I think you should firstly change the data structure . after that it would be easy.
Data one; input reason : $ year $ cas pct ; cards; XYZ 2010 68 51.9084 Others 2010 63 48.0916 XYZ 2011 169 62.3616 Others 2011 102 37.63 XYZ 2012 88 56.0510 Others 2012 69 43.9494 ; run; data two; set one; length rea $ 50; rea=catx('_',reason,'cas');value=cas;output; rea=catx('_',reason,'pct');value=pct;output; keep rea year value; run; proc tabulate data=two order=data; class rea year; var value; table rea=' ' , year=' '*value=' '*sum=' ' ; run;
Ksharp
Hi:
You say you want gridlines and you are using some ODS style= overrides in your syntax, but I do not see any ODS statements in your posted code. What is your destination of interest? HTML, RTF, PDF, SASReport (inside Enterprise Guide), CSV or ????
That would be good information to know.
cynthia
Hi,
I got it worked somehow , but not sure....let me know your openion plz.
data one;
input reason : $ year $ cas pct;
cards;
XYZ 2010 68 51.9084
Others 2010 63 48.0916
XYZ 2011 169 62.3616
Others 2011 102 37.63
XYZ 2012 88 56.0510
Others 2012 69 43.9494
;
run;
data two;
set one;
rea=catx('_',reason,'cas');value=cas;output;
rea=catx('_',reason,'pct');value=pct;output;
keep rea year value;
run;
proc sort data=two;
by rea year;
run;
proc tanspose data=two out=three(drop=_Name_);
id year;
by rea;
var value;
run;
result:
Thanks,
Dear Cynthia, Ksharp, and LHV
Your prompt and proposed soultion worked great. Appreciate your time and interest. I will use ODS style statements to display grids.
Regards,
Girish Patel
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.