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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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