Introduction to ArtificiaI Intelligence in Higher Education
as400 built in function- %ABS
1. %ABS (Absolute value of a numeric)
This built-in function is used to get the absolute value of a numeric expression.
Example –%abs built-in function in rpgle
D float
s
8f
D integer
s
D packed
s
inz (-1)
10i 0 inz (-123)
7p 3 inz (-1234.567)
/FREE
f8
= %abs (float);
i10 = %abs (integer);
p7
= %abs (packed);
/END-FREE
// "float" is now 1.
// "integer" is now 123.
// "packed" is now 1234.567.