BookmarkSubscribeRSS Feed
nzrdufiu
Obsidian | Level 7

I am having a new problem. 

My imaginary data:

Sample firms:

yr       tick sic  asset

2011 AB 20 2000
2011 BC 21 3000
2011 CD 22 4000
2011 DE 23 5000
2011 EF 24 6000

 

Control firms:

yr       tick sic  asset

2011 DE 20 900
2011 XS 24 3300
2011 SA 23 2600
2011 FR 22 2000

2011 TH 22 1500

2011 YU 23 2500

 

My question:

I want to match firms on the basis of sic and asset. My condition is sample firms' asset may be 50% of control firms or vice verse. WHat should be my coding? 

 

Thank you.

1 REPLY 1
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Hi,

 

You say nothing about what you want in the output dataset, what the linking variables should be, what you mean by "matching" etc.  You should be able to construct a simple SQL statement to do this, condition, you could have where (sample.asset /100)*50 <= control.asset <= (sample.asset/100)* 150.

 

Joins are (note these examples would need to be in a proc sql; quite; block):

Capture.PNG

 

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 725 views
  • 0 likes
  • 2 in conversation