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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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