BookmarkSubscribeRSS Feed
chrissowden
Obsidian | Level 7

Capture.PNG

Where the endpoint is December 2006—e.g. 3 month return refers to return over Oct, Nov & Dec of 2006;

3 year return refers to Jan 2004 through December 2006

 

I am having a hard time getting the monthly and yearly returns

here is my code:

 

proc sort data=mysas.funds out=funds;
 by indicecode  ;
 where year(dt) <= 2006;
run;
data ex1;
 set funds end=last;
 by indicecode ;
 
 
  if last.indicecode then do;
   count=_n_;
   col1=(fund_tot + return)*100;
 
  output;
 end;
 
/*  keep indicecode mean return count; */
run;
3 REPLIES 3
ballardw
Super User

I think that you need  some description of the input data set FUNDS if the purpose is to create output similar to the posted picture.

Note that such a picture does not actually provide variable names or even data types.

 

Best would be to provide some example data from your FUNDS or possibly the MYSAS.FUNDS data set in the form of data step code.

 

Also you should provide descriptions of the time frames for the 6 month, 1 year and 2 year results if desired. Otherwise we are extremely like to make an assumption that does not match your time frame.

 

 

chrissowden
Obsidian | Level 7
That is the entire instructions that I have.
ballardw
Super User

@chrissowden wrote:
That is the entire instructions that I have.

So you are saying that you do not have a funds data set?

I asked for a description of the input data set. If you do not have such a data set then I don't think there is anyway anyone could answer this question.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1173 views
  • 0 likes
  • 2 in conversation