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'

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 670 views
  • 0 likes
  • 2 in conversation