DATA Step, Macro, Functions and more

how to delete zero and negative value from a column

Accepted Solution Solved
Reply
Contributor
Posts: 72
Accepted Solution

how to delete zero and negative value from a column

how i can delete zero values and negative values from a column in a data. Thanks.


Accepted Solutions
Solution
‎06-17-2016 02:08 AM
Super Contributor
Posts: 336

Re: how to delete zero and negative value from a column

For example:

 

Data A (Where=(X gt 0));
  Do i=1 To 100;
    X=Round(Rannor(1)-0.5,0.1);
	Output; 
  End;
Run;

View solution in original post


All Replies
Solution
‎06-17-2016 02:08 AM
Super Contributor
Posts: 336

Re: how to delete zero and negative value from a column

For example:

 

Data A (Where=(X gt 0));
  Do i=1 To 100;
    X=Round(Rannor(1)-0.5,0.1);
	Output; 
  End;
Run;
New Contributor
Posts: 4

Re: how to delete zero and negative value from a column

Wouldn't this just delete those observations instead of just the values for that observation in the column? Why not something like:

 

if var1 <= 0 then var1 = .;

 

Can you explain the difference for answering the original post?

☑ This topic is solved.

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

Discussion stats
  • 2 replies
  • 248 views
  • 1 like
  • 3 in conversation