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?

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 690 views
  • 0 likes
  • 3 in conversation