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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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