Hi Team,
I have below query which takes 30minutes to complete.
Could you please suggest any bottleneck here.
proc sql;
create table X as ( select * from Y a inner join Z b on input(b.emp_id,11.) = a.emp_id
where a.sale_dt >= b.sale_dt and a.sale_dt < b.sale_last_dt );
quit;
Source Table A has: 3.6M data & B table has 3.3M data.
Output of this query gives 3.5M data and its taking 30 min to complete. Is there any way to reduce the process time.
Please suggest?
Here is :
proc sql;
create table X as ( select * from Y a inner join Z b on input(b.emp_id,11.) = a.emp_id
where a.sale_dt >= b.sale_dt and a.sale_dt < b.sale_last_dt );
quit;
Make a data step before SQL to convert this variable by INPUT().
data Y1; set Y; new_emp_id=input(emp_id,11.); run; proc sql; ..................
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.