Help using Base SAS procedures

delete rows

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 118
Accepted Solution

delete rows

I want to delete rows.

this is my program

data flux0;

set flux;

if mtna='T' then delete;

run;

I have this message???????????????

ERROR: LIKE operator requires character operands.


Accepted Solutions
Solution
‎11-11-2014 02:17 PM
PROC Star
Posts: 7,467

Re: delete rows

I'm going to guess that you left off a colon (i.e., =: rather than =), but that your problem is that you are trying to delete records that contain .T, not the character value 'T'.

Try the following:

data flux0;

  set flux;

  if mtna =.T then delete;

run;

View solution in original post


All Replies
Super User
Posts: 5,497

Re: delete rows

Nope.  No way.  Didn't happen.  That message could not possible emerge from that DATA step.

Check for a missing semicolon on the statement before the DATA statement.  Make sure you have a blank before the word "then".  Otherwise, you will just have to post your log.

Good luck.

Solution
‎11-11-2014 02:17 PM
PROC Star
Posts: 7,467

Re: delete rows

I'm going to guess that you left off a colon (i.e., =: rather than =), but that your problem is that you are trying to delete records that contain .T, not the character value 'T'.

Try the following:

data flux0;

  set flux;

  if mtna =.T then delete;

run;

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 234 views
  • 0 likes
  • 3 in conversation