0
votes

So like in title I'm trying to write code that will summarize few column after proc transpose. And also is there any option to use Column(1), Column(2) instead of column real label? I'm transposing date so my new label are date and in every day they are changing, so I cant type every day new date.

anyone?

its something like this:

http://i62.tinypic.com/24d07dw.jpg

1
Yes, this is possible. Post an example of what you've got data-wise and what you're doing in the transpose, and what you want the proc means to do.Joe

1 Answers

0
votes

the following code should do what you asked for.

By specifying no variable in the proc means you'll obtain a sum for all the numeric vars. Then you only have to drop those you are not interested in.

/* sample data */
data in;
    input id date date9. value;
    format date date9.;
    datalines;
1 1jan2012 10
1 2jan2012 20
1 3jan2012 30
2 1jan2012 40
2 2jan2012 50
2 3jan2012 60
;
run;
/* transpose */
proc transpose data=in out=out (drop=name);
    by id;
    id date;
    var value;
run;

/* summarize & append */
proc means data=out noprint;
    output out=sum (drop=id _type_ _freq_) sum=;
run;
proc append base=out data=sum force;
run;