Ü  %DAYS (Number of Days)

 

%DAYS converts a number into a duration that can be added or subtracted to a date or timestamp value to affect its day’s segment.

 

Example –%days built-in function in rpgle

 


Columns . . . :    6  80                  Browse                            AMITCC/QRPGLESRC
SEU==>                                                                               BIN_DAY
FMT D  DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++++
*************** Beginning of data **************************************************
0001.00 DDATE0            S               D   INZ(D'2011-01-12')                      130201
0002.00 DDATE1            S               D                                             130201
0003.00 DTIMESTP0         S               Z                                             130201
0004.00 DTIMESTP1         S               Z                                             130201
0005.00 C                   EVAL      DATE1=DATE0 + %DAYS(2)                            130201
0006.00 C     DATE0         DSPLY                                                       130201
0007.00 C     DATE1         DSPLY                                                       130201
0008.00 C                   TIME                    TIMESTP0                            130201
0009.00 C                   EVAL      TIMESTP1=TIMESTP0 - %DAYS(2)                      130201
0010.00 C     TIMESTP0      DSPLY                                                       130201
0011.00 C     TIMESTP1      DSPLY                                                       130201
0012.00 C                   SETON                                        LR             130201
****************** End of data *****************************************************



OUTPUT

 

2011-01-12                             
2011-01-14                             
2013-02-01-01.31.47.395000             
2013-01-30-01.31.47.395000 





User Comments:





Copyright © Go4as400.com, 2013-2017. Copyright notice