BookmarkSubscribeRSS Feed
Banu
Obsidian | Level 7

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?

 

 

 

 

1 REPLY 1
Ksharp
Super User

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;
..................

 

 

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!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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