BookmarkSubscribeRSS Feed
sasphd
Lapis Lazuli | Level 10

I have tables 1 and 2 and I want table 3

5 REPLIES 5
LinusH
Tourmaline | Level 20

Don't attach Excel files. Include any sample data as data step w/ datalines/cards.

Also, what have you tried so far?

Data never sleeps
ballardw
Super User

Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.

 

If you have your example data in SAS data sets then the instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to create data step code that you can post in the forum, use the code box usinging the {i} menu item, or attach as text files. Then we know exactly what the data looks like.

sasphd
Lapis Lazuli | Level 10

i did not succeed to attach sas files why

sasphd
Lapis Lazuli | Level 10

table 1

 

Rank_NO crsp_fundno MGR_DT
1                      53           1991-01-01
1                      53            1999-01-01
2                    105             1985-01-01
2                    105             1985-06-01

 

 

table 2

Rank_NO crsp_fundno caldt mret
1 53 1990-11-30 1,0459
1 53 1990-12-31 1,0250
1 53 1991-01-31 1,0435
1 53 1991-02-28 1,0499
1 53 1991-03-28 1,0078
1 53 1999-01-29 0,9810
1 53 1999-02-26 1,0002
1 53 1999-03-31 1,0238
2 105 1984-12-31 1,0238
2 105 1985-01-31 1,0238
2 105 1985-02-28 1,0238
2 105 1985-03-29 1,0238
2 105 1985-04-30 1,0238
2 105 1985-05-31 1,0238
2 105 1985-06-28 1,0238
2 105 1985-07-31 0,9990

 

 

table 3 

Rank_NO crsp_fundno caldt mret MGR_DT
1 53 1990-11-30 1,0459  
1 53 1990-12-31 1,0250  
1 53 1991-01-31 1,0435 1991-01-01
1 53 1991-02-28 1,0499 1991-01-01
1 53 1991-03-28 1,0078 1991-01-01
1 53 1999-01-29 0,9810 1999-01-01
1 53 1999-02-26 1,0002 1999-01-01
1 53 1999-03-31 1,0238 1999-01-01
2 105 1984-12-31 1,0238  
2 105 1985-01-31 1,0238 1985-01-01
2 105 1985-02-28 1,0238 1985-01-01
2 105 1985-03-29 1,0238 1985-01-01
2 105 1985-04-30 1,0238 1985-01-01
2 105 1985-05-31 1,0238 1985-01-01
2 105 1985-06-28 1,0238 1985-06-01
2 105 1985-07-31 0,999 1985-06-01
LinusH
Tourmaline | Level 20
It would be easier to join if you got an end date for mgr. If the real data set is larger and unpractical for manual edit use a data step with BY and RETAIN to create those.
Then you could do the join using caldt between mgr_dt and mgr_enddt.
Data never sleeps

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 5 replies
  • 1777 views
  • 0 likes
  • 3 in conversation