DATA Step, Macro, Functions and more

Removing/Deleting Observations

Reply
Occasional Contributor
Posts: 5

Removing/Deleting Observations

data reg.regnoouttest;
set reg.regnoout;
delete point {4 30 157 163 164 165 167 171};
run;

i am trying to run the this code and it tells me that I have an syntax error, and is expecting a semicolon. I do not understand why this is happening. I am literlaly typing this word for worf from an example on sas webstie. Can anyone help 

Super User
Posts: 17,828

Re: Removing/Deleting Observations

Really? Post the link please. 

 

It it should be 

 

if point in (list of values here) then delete;

 

Occasional Contributor
Posts: 18

Re: Removing/Deleting Observations

I believe that the "delete point" portion of the code is only used in the SAS\IML product. Try using the following:

 

if point in (4 30 157 163 164 165 167 171) then delete;

 

Super User
Posts: 5,256

Re: Removing/Deleting Observations

Or a bit more efficient:

where point not in (4 30 157 163 164 165 167 171);
Data never sleeps
Ask a Question
Discussion stats
  • 3 replies
  • 218 views
  • 2 likes
  • 4 in conversation