@aalluru wrote:
I have a table that looks something like this (there are actually way more rows and columns than this):
month a b c
202101 1 2 1
202102 4 3 2
I want to make it look like this:
var 202101 202102
a 1 4
b 2 3
c 1 2
Make your dataset "longer", then use PROC REPORT:
proc transpose data=have out=long;
by month;
var a--c; /* variable list by position, only the first and last variable needs to be named */
run;
proc report data=long;
column _name_ col1,month;
define _name_ / "var" group;
define col1 / "" analysis;
define month / "" across;
run;
Wrap the report step into a proper ODS destination for later use as an email attachment.
Code is untested, posted from my tablet.
... View more