i have a table with negative percent
format of the variable: percentn10.2
i have tried: where variable < 0, but does not work, do you know why?
@Sk1_SAS WHAT is not working. Please also provide sample data in the form of a data step as done below and not as a screenshot.
Just wildly guessing: I could imagine that you could get an unexpected result if you condition was variable <= 0 Not sure about variable <0
Best provide sample data and your selection and tell us where your condition doesn't work as you'd expect.
data have;
input variable;
format variable percentn10.2;
datalines;
-0.0016
-0.0166
0
0.000001
-0.000001
;
proc print data=have;
where variable<0;
run;
What do you mean by "does not work"? Please state what happens, in enough details so I can understand what you are seeing, or show us the incorrect results.
Please show us the full LOG of the code you are running, so we can see the code as it is displayed in the log, plus any ERRORs, WARNINGs and NOTEs. Do not chop out parts of the log. Do not pick and choose parts of the log to show us, and then not show us other parts.
@Sk1_SAS WHAT is not working. Please also provide sample data in the form of a data step as done below and not as a screenshot.
Just wildly guessing: I could imagine that you could get an unexpected result if you condition was variable <= 0 Not sure about variable <0
Best provide sample data and your selection and tell us where your condition doesn't work as you'd expect.
data have;
input variable;
format variable percentn10.2;
datalines;
-0.0016
-0.0166
0
0.000001
-0.000001
;
proc print data=have;
where variable<0;
run;
Always (as in
ALWAYS
) show us the code you used, and the complete log from it, when it "does not work".
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.