+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15

Thread: Get the day of the week in CL

  1. #1
    Guest.Visitor Guest

    Default Get the day of the week in CL

    How can I get the day of the week using CL ? Silvio Santos silvio.santos@biw-ag.de

  2. #2

    Default Get the day of the week in CL

    On Wednesday, August 19, 1998, 03:48 AM, Sílvio Santos wrote: How can I get the day of the week using CL ? System value QDAYOFWEEK (use RTVSYSVAL command) will give you the day of week for the current system date. Best regards, Carsten Flensburg

  3. #3

    Default Get the day of the week in CL

    On Wednesday, August 19, 1998, 03:48 AM, Sílvio Santos wrote: How can I get the day of the week using CL ? Silvio Santos silvio.santos@biw-ag.de Like this:
    PGM DCL VAR(&InDate) TYPE(*CHAR) LEN(32) + VALUE('08/19/1998 ') DCL VAR(&InPict) TYPE(*CHAR) LEN(32) + VALUE('MM/DD/YYYY ') DCL VAR(&OUTPICT) TYPE(*CHAR) LEN(32) + VALUE('Wwwwwwwwww ') DCL VAR(&OutDate) TYPE(*CHAR) LEN(32) DCL VAR(&LilDate) TYPE(*CHAR) LEN(4) DCL VAR(&FC) TYPE(*CHAR) LEN(12) CALLPRC PRC(CEEDAYS) PARM(&INDATE &INPICT &LILDATE &FC) CALLPRC PRC(CEEDATE) PARM(&LILDATE &OUTPICT &OUTDATE)/* Value of &OUTDATE is 'Wednesday ' */ ENDPGM
    One day, we'll all be heroes.

  4. #4
    Guest.Visitor Guest

    Default Get the day of the week in CL

    If what you want is the day of the week for TODAY (wednesday) just do RTVSYSVAL , hit CMD4 and pick out the variable you want... You don't need a bunch of CODE .
    ......
     

    Bob Hamilton TEXAS BUSINESS SYSTEMS 736 Pinehurst Richardson, Texas 75080


  5. #5
    Guest.Visitor Guest

    Default Get the day of the week in CL

    On Wednesday, August 19, 1998, 04:50 PM, Bob Hamilton wrote: If what you want is the day of the week for TODAY (wednesday) just do RTVSYSVAL , hit CMD4 and pick out the variable you want... You don't need a bunch of CODE . ...... Bob Hamilton TEXAS BUSINESS SYSTEMS 736 Pinehurst Richardson, Texas 75080
    Thanks I was about to type the same response...........sometimes letting the air out of the tires to free the truck from the bridge is just too simple. Just trying to keep up....

  6. #6

    Default Get the day of the week in CL

    On Wednesday, August 19, 1998, 03:48 AM, Sílvio Santos wrote: How can I get the day of the week using CL ? Silvio Santos silvio.santos@biw-ag.de I see nothing in Silvio's original post that indicates he only wants the day of the week for today. In my experience, the date a program is manipulating is almost never today. It's order date, or hire date, or month-end date, etc. I merely gave him a solution that works for ALL dates. Was I wrong? One day, we'll all be heroes.

  7. #7
    Guest.Visitor Guest

    Default Get the day of the week in CL

    On Thursday, August 20, 1998, 06:58 AM, Michael Daly wrote: I see nothing in Silvio's original post that indicates he only wants the day of the week for today. In my experience, the date a program is manipulating is almost never today. It's order date, or hire date, or month-end date, etc. I merely gave him a solution that works for ALL dates. Was I wrong? Michael, FWIW: Your answer was excellent. It covered all dates. I nominate it for Tech Talk. Chris

  8. #8

    Default Get the day of the week in CL

    On Thursday, August 20, 1998, 07:37 AM, Chris Ringer wrote: Michael, FWIW: Your answer was excellent. It covered all dates. I nominate it for Tech Talk. Chris Thanks, Chris, for the vote of confidence. TechTalk? Maybe. Perhaps I should add some error checking and pass the parms in? Maybe something like this:
     /**************************************************  ****//* *//* PROGRAM : DayOfWeek *//* CREATED BY: Michael Daly *//* CREATED DT: 08/20/1998 *//* PURPOSE: To return the day of the week provided *//* a given date. *//**************************************************  ****/ PGM PARM(&INDATE &INPICT &OUTDATE &ERRCODE) DCL VAR(&InDate) TYPE(*CHAR) LEN(32) DCL VAR(&InPict) TYPE(*CHAR) LEN(32) DCL VAR(&OutDate) TYPE(*CHAR) LEN(32) DCL VAR(&ERRCODE) TYPE(*CHAR) LEN(1) DCL VAR(&OUTPICT) TYPE(*CHAR) LEN(32) + VALUE('Wwwwwwwwww') DCL VAR(&LilDate) TYPE(*CHAR) LEN(4) DCL VAR(&FC) TYPE(*CHAR) LEN(12) DCL VAR(&ISI) TYPE(*CHAR) LEN(4) DCL VAR(&ISIDEC) TYPE(*DEC) LEN(9 0) CALLPRC PRC(CEEDAYS) PARM(&INDATE &INPICT &LILDATE &FC) CHGVAR VAR(&ISI) VALUE(%SST(&FC 9 4)) CHGVAR VAR(&ISIDEC) VALUE(%bin(&ISI)) IF COND(&ISIDEC *EQ 0) THEN(DO) CALLPRC PRC(CEEDATE) PARM(&LILDATE &OUTPICT &OUTDATE) CHGVAR VAR(&ERRCODE) VALUE('N') ENDDO ELSE CMD(DO) CHGVAR VAR(&ERRCODE) VALUE('Y') ENDDO ENDPGM
    One day, we'll all be heroes.

  9. #9

    Default Get the day of the week in CL

    I have submitted it to the proper person.
    On Thursday, August 20, 1998, 09:05 AM, Michael Daly wrote: Thanks, Chris, for the vote of confidence. TechTalk? Maybe. Perhaps I should add some error checking and pass the parms in? Maybe something like this: /************************************************** ****/ /* */ /* PROGRAM : DayOfWeek */ /* CREATED BY: Michael Daly */ /* CREATED DT: 08/20/1998 */ /* PURPOSE: To return the day of the week provided */ /* a given date. */ /************************************************** ****/ snip

  10. #10
    Guest.Visitor Guest

    Default Get the day of the week in CL

    On Thursday, August 20, 1998, 02:01 PM, Ted Holt wrote: I have submitted it to the proper person. On Thursday, August 20, 1998, 09:05 AM, Michael Daly wrote: Thanks, Chris, for the vote of confidence. TechTalk? Maybe. Perhaps I should add some error checking and pass the parms in? Maybe something like this: /************************************************** ****/ /* */ /* PROGRAM : DayOfWeek */ /* CREATED BY: Michael Daly */ /* CREATED DT: 08/20/1998 */ /* PURPOSE: To return the day of the week provided */ /* a given date. */ /************************************************** ****/ snip It's already in my folder to share with the team, Thanks!! There's never time to do it right, but.....there's always time to do it over.

+ Reply to Thread
Page 1 of 2 1 2 LastLast

Similar Threads

  1. Day of the week
    By Guest.Visitor in forum Programming
    Replies: 12
    Last Post: 12-19-2001, 08:16 AM
  2. I need to know what day of the week
    By Guest.Visitor in forum Programming
    Replies: 6
    Last Post: 07-19-2001, 01:45 PM
  3. Day of the Week
    By Guest.Visitor in forum Programming
    Replies: 9
    Last Post: 05-29-2001, 03:41 PM
  4. What day of week is this???
    By Guest.Visitor in forum Programming
    Replies: 7
    Last Post: 11-25-1997, 12:20 PM
  5. Day of Week
    By M.Martinez in forum Programming
    Replies: 2
    Last Post: 08-19-1997, 11:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts