%DECH Built-In Functions in rpgle

It is used to Round-off decimal places.

%DECH is the same as %DEC built-in function except that the half adjust is also performed if the expression is a decimal or float value.


Example –%dech built-in function in rpgle


Da3                              7P 4
Da2                              5P 2
C                   eval      a3=111.1376
C                   eval      a2=%DECH(a3:5:2)
C     a3            dsply
C     a2            dsply





a3 = 111.1376

a2 = 111.14



User Comments:



Copyright © www.go4as400.com, 2013-2017. Copyright notice