BookmarkSubscribeRSS Feed
Siva_Harish
Obsidian | Level 7

Hello Community,

 

I have a query which looks like below,it is taking a more than an hour to update the dataset ds .

can anyone help me to write a hash code to run fast ?

 

 proc sql;
 update lib.ds as us
 set name=( select name from sashelp.class as g
							   where us.type= g.name
	where us.name in ( select weight from sashelp.cars)
          and us.name is null;
 quit;
2 REPLIES 2
ballardw
Super User

@Siva_Harish wrote:

Hello Community,

 

I have a query which looks like below,it is taking a more than an hour to update the dataset ds .

can anyone help me to write a hash code to run fast ?

 

 proc sql;
 update lib.ds as us
 set name=( select name from sashelp.class as g
							   where us.type= g.name
	where us.name in ( select weight from sashelp.cars)
          and us.name is null;
 quit;

Your example code has unbalanced quotes so I would not expect it to run at all.

 

Provide actual code. If your data set or variable names are "sensitive" then replace those bits with nonsense strings.

 

How many records are involved in these sets? Are they actually native SAS data sets or are you connecting to another DBMS?

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
  • 2 replies
  • 473 views
  • 0 likes
  • 3 in conversation