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.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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