I have a data set that has quantitave values by time and type. I wish to summarize these in a different way, so that I can see percntage breakdown of type by time. Here is the data set:
data have;
input loc $ prod $ time $ type $ total;
cards;
L1 P1 1 xxx 10
L1 P1 1 yyy 30
L1 P1 1 yyy 60
L1 P2 1 xxx 20
L1 P1 2 xxx 25
L1 P2 2 yyy 60
;
run;
I want to end up with something like this:
loc prod type time1 time2
L1 P1 xxx .1 1
L1 P1 yyy .9 0
L1 P2 xxx 1 0
L1 P2 yyy 0 1
I imagine this will require an array of some sort, but am having trouble sorting out how to get the syntax right. I also thought maybe proc report may work, but not sure. I will need the output to be a dataset.
Thanks for help.
Pyll