Ü EXTRCT (Extract Date/Time/Timestamp)

     This opcode extracts:

·         Year, month or day segment of a date or timestamp value

·         Hours, minutes or seconds segment of a time or timestamp value

·         Microseconds segment of a timestamp value

 

Factor 1

Op-code

Factor 2

Result Field

Resulting Indicators

       HI                            LO                      EQ

EXTRCT(E)

Date/Time/Timestamp: Duration opcode

Target field

 

Error

 

 

Example

 


Columns . . . :    6  80                    Browse                             AMINEM/QRPGLESRC
SEU==>                                                                               DATE_TIME3
FMT D  DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++++
*************** Beginning of data *****************************************************
0001.00 DDATE0            S               D                                             130124
0002.00 DD1               S              5  0 INZ(*ZEROS)                               130124
0003.00 DD2               S              2  0 INZ(*ZEROS)                               130124
0004.00 DD3               S              2  0 INZ(*ZEROS)                               130124
0005.00 DTIME0            S               T                                             130124
0006.00 DT1               S              2  0 INZ(*ZEROS)                               130124
0007.00 DT2               S              2  0 INZ(*ZEROS)                               130124
0008.00 DT3               S              2  0 INZ(*ZEROS)                               130124
0009.00 DTIMESTP0         S               Z                                             130124
0010.00 DSTP              S              6P 0 INZ(*ZEROS)                               130124
0011.00 C                   MOVEL     *DATE         DATE0                               130124
0012.00 C                   EXTRCT    DATE0:*Y      D1                                  130124
0013.00 C                   EXTRCT    DATE0:*M      D2                                  130124
0014.00 C                   EXTRCT    DATE0:*D      D3                                  130124
0015.00 C                   TIME                    TIME0                               130124
0016.00 C                   EXTRCT    TIME0:*H      T1                                  130124
0017.00 C                   EXTRCT    TIME0:*MN     T2                                  130124
0018.00 C                   EXTRCT    TIME0:*S      T3                                  130124
0019.00 C                   TIME                    TIMESTP0                            130124
0020.00 C                   EXTRCT    TIMESTP0:*MS  STP                                 130124
0021.00 C     DATE0         DSPLY                                                       130124
0022.00 C     D1            DSPLY                                                       130124
0023.00 C     D2            DSPLY                                                       130124
0024.00 C     D3            DSPLY                                                       130124
0025.00 C     TIME0         DSPLY                                                       130124
0026.00 C     T1            DSPLY                                                       130124
0027.00 C     T2            DSPLY                                                       130124
0028.00 C     T3            DSPLY                                                       130124
0029.00 C     TIMESTP0      DSPLY                                                       130124
0030.00 C     STP           DSPLY                                                       130124
0031.00 C                   SETON                                            LR         130124
****************** End of data **********************************************************


 

OUTPUT

 

2013-01-24                       

 2013                            

 1                               

24                               

07.08.12                         

 7                               

 8                               

12                                

2013-01-24-07.08.12.607000       

607000                           

 











User Comments:



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