BookmarkSubscribeRSS Feed
Songchan
Calcite | Level 5

Hello,

 

I matched two data sets using one condition (cusip number), now I'm going to match the lost matched observations with another condition (ticker number) I don't know how.

 

/*merge by cusip*/

proc sql;
create table cc as
select a.*,b.*
from aa02 as a, bb as b
where a.COL3=b.cusip and -5<=a.tr-b.datadate<370;
quit; 

 

 

aa02 (891201 observations) is one dataset, bb is another one, and there are only 140110 observations matched. 

4 REPLIES 4
PeterClemmensen
Tourmaline | Level 20

So you want to match the 891201-140110 non matched observations with observations from a third data set or?

 

If not, please be more specific.

Songchan
Calcite | Level 5

Hello,

I want to matched the rest observations (891201-140110) in aa02 data set with bb data set. Because what I want to do is to match the two data sets with CUISP number, Ticker number and Company Names, I just finished matching with CUISP number, and only 140110 out of 891201 are matched, that is not a good match.

PGStats
Opal | Level 21

"I want to do is to match the two data sets with CUISP number, Ticker number and Company Names"

 

that doesn't (shouldn't) require separate steps. It can all be done in one operation.

 

What makes you expect to get more matches?

PG
Songchan
Calcite | Level 5

Hello,

 

I have two data sets, one is monthly data, the other is annual data, I need to combine these two to ensure that each company has its both monthly and annual data. The first condition is CUSIP number, and the rest observations of monthly data match annual data under the second condition of same ticker number, there also should be some observations not matched,  so the last condition is company name.

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