ILERPG, getting dayofweek from system - IBM AS400

This is a discussion on ILERPG, getting dayofweek from system - IBM AS400 ; Is there an easy way to do this. I toyed with using CL and passing parm but would rather do it in ILE....

+ Reply to Thread
Results 1 to 2 of 2

Thread: ILERPG, getting dayofweek from system

  1. ILERPG, getting dayofweek from system

    Is there an easy way to do this.

    I toyed with using CL and passing parm but would rather do it in ILE.


  2. Re: ILERPG, getting dayofweek from system

    On Oct 1, 12:46*pm, iseriesflorida wrote:
    > Is there an easy way to do this.


    If you can use embedded SQL, just use one of the following scalar
    functions:
    DayOfWeek(Date): Returns the numeric day of week where sunday is 1 and
    saturday 7
    DayOfWeek_ISO(Date): Returns the numeric day of week where monday is 1
    and sunday is 7
    DayName: Return the name of the day of week, i.e. Monday, Tuesday ...

    To embedd SQL the source attribute must be set to SQLRPGLE.
    The following example shows how to determine the day of week for a
    given date:

    C/Exec SQL Set :NumWeekDay = DayOfWeek_ISO(:MyDate)
    C/End-Exec

    Birgitta

+ Reply to Thread