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!
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.