Ü  ADD(H) (Add)  

·         This op-code adds factor-1 with factor-2 to place the sum in result field.

·         It can be used for packed, signed, binary, integer, array element, data structure subfield.

·         For DATE, TIME, and TIMESTAMP values, the ADDDUR operation is used.

·         The H operation extender makes the result half-adjusted i.e. it does the round-up of the result.

Factor 1

Op-code

Factor 2

Result Field

Resulting Indicators

       HI                            LO                      EQ

  value 1

ADD(H)

  value 2

Sum of value1 & value2

Result > 0

Result < 0

Result >=0

 

Example


Columns . . . :    6  80                  Browse                              AMINEM/QRPGLESRC
SEU==>                                                                             OPCODE_ADD
FMT D  DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++++
*************** Beginning of data ****************************************************
0001.00 Da                S              2  0 INZ(11)                                   130125
0002.00 Db                S              2  0 INZ(22)                                   130125
0003.00 Dc                S              2  0 INZ(0)                                    130130
0004.00 Dd                S              2  0 INZ(-22)                                  130130
0005.00 C     a             ADD       b             c                    414243         130130
0006.00 C                   ADD       d             a                    515253         130130
0007.00 C                   ADD       22            d                    616263         130130
0008.00 C     c             DSPLY                                                       130125
0009.00 C     *In41         DSPLY                                                       130130
0010.00 C     *In42         DSPLY                                                       130130
0011.00 C     *In43         DSPLY                                                       130130
0012.00 C     a             DSPLY                                                       130130
0013.00 C     *In51         DSPLY                                                       130130
0014.00 C     *In52         DSPLY                                                       130130
0015.00 C     *In53         DSPLY                                                       130130
0016.00 C     d             DSPLY                                                       130130
0017.00 C     *In61         DSPLY                                                       130130
0018.00 C     *In62         DSPLY                                                       130130
0019.00 C     *In63         DSPLY                                                       130130
0020.00 C                   SETON                                        LR             130125
****************** End of data *******************************************************



OUTPUT

DSPLY  33  

DSPLY  1   

DSPLY  0   

DSPLY  0   

DSPLY  11- 

DSPLY  0   

DSPLY  1   

DSPLY  0   

DSPLY  0  

DSPLY  0   

DSPLY  0   

DSPLY  1   

 











User Comments:



Subscribe

.  


Copyright © www.go4as400.com, 2013-2023. Copyright notice   Terms of services   Privacy policy