Ü   ADDDUR

·         ADDDUR operation code is used to perform arithmetic sum of duration in factor-2 with DATE, TIME, or TIMESTAMP value in factor-1. The result is placed in result field.

·         Valid duration codes are *YEARS, *MONTHS, *DAYS, *HOURS, *MINUTES, *SECONDS, *MSECONDS.

·         Abbreviated duration codes can also be used:  *Y, *M, *D, *H, *MN, *S, *MS.

Factor 1

Op-code

Factor 2

Result Field

Resulting Indicators

       HI                            LO                      EQ

DATE, TIME, or TIMESTAMP value

ADDDUR(E)

Duration value : Duration code

Sum of factor-1 and factor-2

Error Indicator

 

Example


Columns . . . :    6  80                 Browse                               AMINEM/QRPGLESRC
SEU==>                                                                              DATE_TIME
FMT D  DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++++
*************** Beginning of data ***************************************************
0001.00 DDATE0            S               D                                             130124
0002.00 DDATE1            S               D                                             130124
0003.00 DDATE2            S               D                                             130124
0004.00 DDATE3            S               D                                             130124
0005.00 DTIME0            S               T                                             130124
0006.00 DTIME1            S               T                                             130124
0007.00 DTIME2            S               T                                             130124
0008.00 DTIME3            S               T                                             130124
0009.00 DTIMESTP0         S               Z                                             130124
0010.00 DTIMESTP1         S               Z                                             130124
0011.00 C                   MOVEL     *DATE         DATE0                               130124
0012.00 C     DATE0         ADDDUR    01:*Y         DATE1                               130124
0013.00 C     DATE0         ADDDUR    01:*M         DATE2                               130124
0014.00 C     DATE0         ADDDUR    01:*D         DATE3                               130124
0015.00 C                   TIME                    TIME0                               130124
0016.00 C     TIME0         ADDDUR    01:*H         TIME1                               130124
0017.00 C     TIME0         ADDDUR    01:*MN        TIME2                               130124
0018.00 C     TIME0         ADDDUR    01:*S         TIME3                               130124
0019.00 C                   TIME                    TIMESTP0                            130124
0020.00 C     TIMESTP0      ADDDUR    11111:*MS     TIMESTP1                            130124
0021.00 C     DATE0         DSPLY                                                       130124
0022.00 C     DATE1         DSPLY                                                       130124
0023.00 C     DATE2         DSPLY                                                       130124
0024.00 C     DATE3         DSPLY                                                       130124
0025.00 C     TIME0         DSPLY                                                       130124
0026.00 C     TIME1         DSPLY                                                       130124
0027.00 C     TIME2         DSPLY                                                       130124
0028.00 C     TIME3         DSPLY                                                       130124
0029.00 C     TIMESTP0      DSPLY                                                       130124
0030.00 C     TIMESTP1      DSPLY                                                       130124
0031.00 C                   SETON                                            LR         130124
****************** End of data *******************************************************

 

OUTPUT

2013-01-24                           

2014-01-24                           

2013-02-24                            

2013-01-25                           

06.33.58                             

07.33.58                             

06.34.58                             

06.33.59                             

2013-01-24-06.33.58.126000           

2013-01-24-06.33.58.137111           

 











User Comments:



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