%INTH Built-In Functions in rpgle

 

%INTH function is used to Convert to Integer Format with Half Adjust.

%INTH is very much similar to %INT except that if the expression is a decimal, float or character value, half adjust is applied to the value of the expression while converting it to integer type.

 

Example –%inth built-in function in rpgle

 


Columns . . . :    6  80               Browse                                AMITCC/QRPGLESRC
SEU==>                                                                              BIN_INTH
FMT D  DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++++
*************** Beginning of data ****************************************************
0001.00 DA                S              5P 3 INZ(12.348)                               130201
0002.00 DB                S              5S 3 INZ(12.555)                               130201
0003.00 DC                S              8F   INZ(13.555)                               130201
0004.00 DINT1             S              2  0 INZ(*ZEROS)                               130201
0005.00 C                   EVAL      INT1=%INTH(A)                                     130201
0006.00 C     INT1          DSPLY                                                       130201
0007.00 C                   EVAL      INT1=%INTH(B)                                     130201
0008.00 C     INT1          DSPLY                                                       130201
0009.00 C                   EVAL      INT1=%INTH(C)                                     130201
0010.00 C     INT1          DSPLY                                                       130201
0011.00 C                   SETON                                        LR             130201
****************** End of data *******************************************************



      

OUTPUT

 

12

13

14










User Comments:



Subscribe

  Email:



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