BookmarkSubscribeRSS Feed
Zarinasa2003
Calcite | Level 5

Thank you for reading my question. I am brand new! I only started learning SAS today and even worse I have a tight deadline. 

 

I have some code that replicates Kenneth French’s industry portfolios!

 

My problem is I need this adapting so that it can be run with a different dataset.

 

I have data in excel:

 

DATE: INDUSTRY: COMPANY NAME: RETURN: MARKET CAP

 

Likewise to the above data I would like value weighted returns that are rebalanced every June.

 

I think this isn’t such as difficult task but the problem I am having is that I am very new to SAS so any advice on how I could do this would be appreciated.

 

Here is the link to the SAS code that I believe does this already. By problem is that I have different data in the above format.

 

https://wrds-www.wharton.upenn.edu/pages/support/research-wrds/research-guides/procedures-using-fama...

 

3 REPLIES 3
Reeza
Super User

Do you have access to WRDS? In this situation, the best method to get it working as fast as possible is to work with the demo and ensure you can get that working and understand it.

Then, rather than modify the code, modify your input data set to match the input data set for the example by restructuring and renaming as necessary and then using that code. 

 


@Zarinasa2003 wrote:

Thank you for reading my question. I am brand new! I only started learning SAS today and even worse I have a tight deadline. 

 

I have some code that replicates Kenneth French’s industry portfolios!

 

My problem is I need this adapting so that it can be run with a different dataset.

 

I have data in excel:

 

DATE: INDUSTRY: COMPANY NAME: RETURN: MARKET CAP

 

Likewise to the above data I would like value weighted returns that are rebalanced every June.

 

I think this isn’t such as difficult task but the problem I am having is that I am very new to SAS so any advice on how I could do this would be appreciated.

 

Here is the link to the SAS code that I believe does this already. By problem is that I have different data in the above format.

 

https://wrds-www.wharton.upenn.edu/pages/support/research-wrds/research-guides/procedures-using-fama...

 


 

Zarinasa2003
Calcite | Level 5

Thanks, 

 

Yes I see what you’re saying but I unforentuatley do not have WRDS.

 

Best wishes

 

 

Zarina 

Reeza
Super User
Then you don't know how the input data set is formatted (and neither do we) so I don't think this approach will work for you.

If you can provide the full logic with a small input data set and expected output someone may be able to help you with the code, but it will need to be a fully worked example to get it going. You can also search on LexJansen.com to see if there's other code examples there that may work for you. Good Luck.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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
  • 427 views
  • 0 likes
  • 2 in conversation