BookmarkSubscribeRSS Feed
willirem
Calcite | Level 5


Hey guys hope you can help me out on this one.

I have a database of 13 ships with alot of other variables.

I am trying to delete one of these ships from my database.

i have a variable collum called: VESSEL

I am using the following code:

Data new;

set Remco.tuna;

if vessel= 'urkkotter' then delete;

run;

Sas runs the code and does create a new table however, it does not delete the vessel 'urkkotter'

resulting in the new table being exactly the same as the Remco.tuna table.

I get no errors or notes in the log file.

Hope you can help out.

Remco.

1 REPLY 1
Tom
Super User Tom
Super User

Most likely the value in the variable is different than what you used in the IF statement.

Possibilities are:

Case differences. Try lowcase(vessel) = 'urkkotter'

Leading spaces in the variable.  Try strip(vessel)='urkkotter'

Other hidden characters such as tab or non-breaking space.  Use PUT VESSEL= $HEX. ; To see in the log the actual values.

The variable is formatted and you are trying to select on the formatted value instead of the actual value.  Try Vvalue(vessel) = 'urkkotter'

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

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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