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 7 of 7

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, 11:46*am, iseriesflorida wrote:
    > Is there an easy way to do this.
    >
    > I toyed with using CL and passing parm but would rather do it in ILE.


    Dont think so - however you can create ILE CL programs, source type
    CLLE then create a srvpgm which can easily be included in your rpg by
    using a function. You may have to add a binding directive to programs
    which use it, I cant remember, we hardly use it (ILE that is) here as
    we are very backward in adopting modern tech. We only use greenscreen
    as the card punches wore out

    Jonathan.

  3. Re: ILERPG, getting dayofweek from system

    There are API's to do this. Take a look at the Date and Time API's in
    the InfoCenter and you'll find which ones to call. I think you'll need
    CEEDAYS and CEEDYWK and by doing some searching, you'll find code
    examples of how to use them.

    Matt

    On Oct 1, 7:53*am, Jonathan Bailey wrote:
    > On Oct 1, 11:46*am, iseriesflorida wrote:
    >
    > > Is there an easy way to do this.

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

    >
    > Dont think so - however you can create ILE CL programs, source type
    > CLLE then create a srvpgm which can easily be included in your rpg by
    > using a function. You may have to add a binding directive to programs
    > which use it, I cant remember, we hardly use it (ILE that is) here as
    > we are very backward in adopting modern tech. We only use greenscreen
    > as the card punches wore out
    >
    > Jonathan.



  4. Re: ILERPG, getting dayofweek from system

    il 01/10/2008 12.46, Scrive iseriesflorida 43949016:
    > Is there an easy way to do this.
    >
    > I toyed with using CL and passing parm but would rather do it in ILE.
    >

    You can use CEE APIs, as already told, or use QWCRSVAL API to retrieve
    sysval QDAYOFWEEK as well.

    --
    Dr.Ugo Gagliardelli,Modena,ItalyCertifiedUindoscrasherAñe joAlcoolInside
    Spaccamaroni andate a cagare/Spammers not welcome/Spammers vão à merda
    Spamers iros a la mierda/Spamers allez vous faire foutre/Spammers loop
    schijten/Spammers macht Euch vom Acker/Spamerzy wypierdalac'

  5. Re: ILERPG, getting dayofweek from system

    Jonathan Bailey wrote:
    > On Oct 1, 11:46 am, iseriesflorida wrote:
    >> Is there an easy way to do this.
    >>
    >> I toyed with using CL and passing parm but would rather do it in ILE.

    >
    > Dont think so - however you can create ILE CL programs, source type
    > CLLE then create a srvpgm which can easily be included in your rpg by
    > using a function. You may have to add a binding directive to programs
    > which use it, I cant remember, we hardly use it (ILE that is) here as
    > we are very backward in adopting modern tech. We only use greenscreen
    > as the card punches wore out
    >


    As mentioned by others, APIs are probably simpler in this case. However
    for future reference re ILE, while using a *SRVPGM or *BNDDIR are good
    options, it can be as simple as binding a module (eg CLLE) into the same
    *PGM object. For example:

    CRTRPGMOD MYLIB/RPGMOD ...
    CRTCLMOD MYLIB/CLMOD ...
    CRTPGM PGM(MYLIB/ABC) MODULE(MYLIB/RPGMOD MYLIB/CLMOD) ...

    ILE Concepts book:
    http://publib.boulder.ibm.com/infoce...s/sc415606.pdf

    --
    Karl Hanson

  6. Re: ILERPG, getting dayofweek from system

    Good one! But sad...

    "Jonathan Bailey" wrote in message
    news:2f9dfcd2-9bea-4269-aa10-

    We only use greenscreen as the card punches wore out



  7. Re: ILERPG, getting dayofweek from system

    On Oct 1, 6:46*am, iseriesflorida wrote:
    > Is there an easy way to do this.
    >
    > I toyed with using CL and passing parm but would rather do it in ILE.


    D NamesOfDays s 9a Dim(7) Ctdata Perrcd(1)
    D Any_Sunday c const(D'2006-01-01')
    **
    D ElapsedDays s 7 0
    D DayNumber s 3
    0
    /Free

    ElapsedDays = %diff(Input_Date: Any_Sunday: *days);
    DayNumber = %rem(ElapsedDays: 7);

    If DayNumber < 0;
    DayNumber = DayNumber + 7;
    Endif;

    Name_of_Day_of_Week = NamesOfDays(DayNumber);

    /End-Free
    **
    SUNDAY
    MONDAY
    TUESDAY
    WEDNESDAY
    THURSDAY
    FRIDAY
    SATURDAY

+ Reply to Thread