Announcement Announcement Module
Collapse
No announcement yet.
Get the day of the week in CL Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

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

    Comment


    • #3
      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.

      Comment


      • #4
        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

        Comment


        • #5
          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....

          Comment


          • #6
            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.

            Comment


            • #7
              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

              Comment


              • #8
                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.

                Comment


                • #9
                  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

                  Comment


                  • #10
                    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.

                    Comment


                    • #11
                      Get the day of the week in CL

                      Please test it with the following dates:
                       February 29th, 1900; February 29th, 2000; October 10th, 1582; February 27th, 1934; September 10th,1752. 

                       

                      Bob Hamilton TEXAS BUSINESS SYSTEMS 736 Pinehurst Richardson, Texas 75080

                      Comment


                      • #12
                        Get the day of the week in CL

                        On Friday, August 21, 1998, 04:41 PM, Bob Hamilton wrote: Please test it with the following dates:
                         February 29th, 1900; February 29th, 2000; October 10th, 1582; February 27th, 1934; September 10th,1752. 
                        Test results:
                        Entry Date: Day of Week Error CodeFebruary 29, 1900 *Blanks 'Y'February 29, 2000 Tuesday 'N'October 10, 1582 *Blanks 'Y'February 27, 1934 Tuesday 'N'September 10, 1752 Sunday 'N' Is this what you expected to see? One day, we'll all be heroes.

                        Comment


                        • #13
                          Get the day of the week in CL

                          On Monday, August 24, 1998, 12:35 PM, Michael Daly wrote: On Friday, August 21, 1998, 04:41 PM, Bob Hamilton wrote:
                          Please test it with the following dates: February 29th, 1900; February 29th, 2000; October 10th, 1582; February 27th, 1934; September 10th,1752. 
                          Test results:
                           Entry Date: Day of Week Error Code February 29, 1900 *Blanks 'Y' February 29, 2000 Tuesday 'N' October 10, 1582 *Blanks 'Y' February 27, 1934 Tuesday 'N' September 10, 1752 Sunday 'N' Is this what you expected to see? One day, we'll all be heroes.  
                          Very good;; Actually the September 10th date did not exist in the English world... As I recall, people went to bed on 9/5/1752and woke up on 9/15/1752. This date did however exist in the standard Gregorian Calendar which was in use in Europe from the 16thcentury...
                          ......
                           

                          Bob Hamilton TEXAS BUSINESS SYSTEMS 736 Pinehurst Richardson, Texas 75080

                          Comment


                          • #14
                            Get the day of the week in CL

                            On Monday, August 24, 1998, 03:14 PM, Bob Hamilton wrote: As I recall, people went to bed on 9/5/1752 and woke up on 9/15/1752. This date did however exist in the standard Gregorian Calendar which was in use in Europe from the 16th century...
                            "As you recall?" Bob, just how old are you? ;-) One day, we'll all be heroes.

                            Comment


                            • #15
                              Get the day of the week in CL

                              On Tuesday, August 25, 1998, 07:26 AM, Michael Daly wrote: On Monday, August 24, 1998, 03:14 PM, Bob Hamilton wrote: As I recall, people went to bed on 9/5/1752 and woke up on 9/15/1752. This date did however exist in the standard Gregorian Calendar which was in use in Europe from the 16th century...
                              "As you recall?" Bob, just how old are you? ;-)
                              That was pretty funny! Very good!

                              Comment

                              Working...
                              X