Tips:ABS Function

From sasCommunity
Jump to: navigation, search

The ABS function can be used to return a positive value...

DATA POSITIVE_INTEGER;
VALUE = abs(-789);
RUN;
PROC PRINT;
RUN;

And now in version 9.2, the SUMABS function is available, and will compute the sum of the absolute value of the non-missing arguments:

DATA POSITIVE_INTEGER;
VALUE = sumabs(-1, 3, 0, ., -10);
RUN;
PROC PRINT;
RUN;

will return a value of 14


....see also


....see also


Submitted by S.M.Ayetullah. Contact me at my Discussion Page.