🔒 This topic is solved and locked.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 03-02-2020 06:09 AM
(13590 views)
good day,
if i got the data like below. what can i do to remove negative value.
number
100
-100
200
-200
thanks in advance
harry
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
There is a difference between changing negative values to positive and removing negative values. I think you want the first, as indicated in your subject.
data have;
input number;
datalines;
100
-100
200
-200
;
data want;
set have;
number = abs(number);
run;
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
There is a difference between changing negative values to positive and removing negative values. I think you want the first, as indicated in your subject.
data have;
input number;
datalines;
100
-100
200
-200
;
data want;
set have;
number = abs(number);
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
data have;
input number;
datalines;
100
-100
200
-200
;
data want;
set have;
where number >= 0;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
thank you all!