Dear all,
I have a table like this:
Fund | ID | Jan 2001 | Feb 2001 | Mar 2001 |
---|---|---|---|---|
Fund 1 | 1 | 1.0 | 2.0 | 3.0 |
Fund 2 | 2 | 1.1 | 2.1 | 3.1 |
Fund 3 | 3 | 0.1 | 0.3 |
And would like to format it, so it looks like this:
Fund | ID | Date | Returns |
---|---|---|---|
Fund1 | 1 | Jan 2001 | 1.0 |
Fund1 | 1 | Feb 2001 | 2.0 |
Fund1 | 1 | Mar 2001 | 3.0 |
Fund2 | 2 | Jan 2001 | 1.1 |
Fund2 | 2 | Feb 2001 | 2.1 |
Fund2 | 2 | Mar 2001 | 3.1 |
Fund3 | 3 | Jan 2001 | 0.1 |
Fund3 | 3 | Feb 2001 | 0.3 |
Of course, I have close to 10,000 funds and the return date (months) are in hundreds.
Any thoughts are greatly appreciated.
Thanks
Daniel
Take a look at proc transpose.
Not sure if this is what you need:
proc transpose data=have out=want;
by fund id;
run;
Take a look at proc transpose.
Not sure if this is what you need:
proc transpose data=have out=want;
by fund id;
run;
how come i forgot this!
need to pick up my little sas book again.
thanks a bunch, reeza!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.