BookmarkSubscribeRSS Feed
Feksan
Fluorite | Level 6

Hello.

I would like to delete the rows where the location is "World". This is my code and it doesn't delete it.

 

DELETE FROM d1.COVID_DATA
WHERE location="world";

2 REPLIES 2
AlanC
Barite | Level 11

I don't have SAS here (can't test) but try to make comparisons neutral, always. For example:

 

upcase(strip(location)) = "WORLD"

 

Lowcase works too.

https://github.com/savian-net
Reeza
Super User

Is that the full code you ran?

 

That wouldn't be valid, you ned to wrap your code in a proc or data step for starters. 

 

If it isn't the full code, please post the actual code and indicate what errors you received or why you think it isn't working. As @AlanC indicated the case does need to match as well. 

 

proc sql;
delete from d1.covid_data
where lowcase(location) = 'world';
quit;

@Feksan wrote:

Hello.

I would like to delete the rows where the location is "World". This is my code and it doesn't delete it.

 

DELETE FROM d1.COVID_DATA
WHERE location="world";


 

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

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 1000 views
  • 2 likes
  • 3 in conversation