I know how PROC transpose works on a single column. But when you have 10 columns, how do you transpose them?
I have a data set like the following:
ID date1 date2 date3 date4 date5 rec1 rec2 rec3 rec4 rec5
I need to create a data set like this:
ID date rec
So, in the original data set, I have everything for ID 1 in one row, and everything for ID 2 in one row...I need to change to a data set that there are 5 rows for each ID. So for ID 1, I will have 5 rows with ID 1 repeating 5 times. How do you do this?
Or can I do it the hard way? Instead of trying to create a data set directly from the old data set, I can break down the old data set into 5 different data set and then use set to combine them back together. Will this work?
For example:
Creating data set 1:
data set1;
set old;
keep ID date1 rec1;
run;
Then I rename date1 and rec1 to date and rec and I will do this for date2-date5 and rec2-rec5. Then at the end, I can just combine them using a set statement like:
data new;
set set1 set2 set3 set4 set5;
run;
Will this work? In theory.
thanks
Message was edited by: cosmid