ROUNDAWAYFROMZERO returns the value of x rounded at a digit specified by n, following the rule of round half away from zero. The result has the mode, base, and scale of x.
>>-ROUNDAWAYFROMZERO(x,n)--------------------------------------><
If x is FIXED DECIMAL or PICTURE FIXED DECIMAL, ROUNDAWAYFROMZERO produces the same results as ROUND.
dcl x float dec(16) init( 3141.592653589793d0 );
display( fixed(roundawayfromzero(x,1),15,7) ); /* 3141.6000000 */
display( fixed(roundawayfromzero(x,2),15,7) ); /* 3141.5900000 */
display( fixed(roundawayfromzero(x,3),15,7) ); /* 3141.5930000 */
display( fixed(roundawayfromzero(x,4),15,7) ); /* 3141.5927000 */
display( fixed(roundawayfromzero(x,5),15,7) ); /* 3141.5926500 */
display( fixed(roundawayfromzero(x,6),15,7) ); /* 3141.5926540 */
display( fixed(roundawayfromzero(x,7),15,7) ); /* 3141.5926536 */