Skip to main content

[archive] Day of the Week from a Date

  • October 31, 2008
  • 3 replies
  • 0 views

[Migrated content. Thread originally posted on 30 October 2008]

How do I get the day of the week from a specific date?

3 replies

[Migrated content. Thread originally posted on 30 October 2008]

How do I get the day of the week from a specific date?
If you look in the sample directory of your ACUCOBOL-GT installation, there should be a file named dayweek.cbl...

[Migrated content. Thread originally posted on 30 October 2008]

How do I get the day of the week from a specific date?
If you look in the sample directory of your ACUCOBOL-GT installation, there should be a file named dayweek.cbl...

[Migrated content. Thread originally posted on 30 October 2008]

How do I get the day of the week from a specific date?
i coded some years ago a programm which i can call to get several date functions. Here is the code snippet for day of the week.


           03  wtg           pic 9          value zeroes. | Day of Week
               88  wt-son                   value 0.
               88  wt-mon                   value 1.
               88  wt-tue                   value 2.
               88  wt-wen                   value 3.
               88  wt-thu                   value 4.
               88  wt-fr                    value 5.
               88  wt-sa                    value 6.
               88  wt-so                    value 7.

       77  tmp-ansi          pic 9(6)       value zeroes. | Date in Ansi-Format


           compute tmp-ansi = function integer-of-date ( i-date ).
           compute wtg      = function rem ( tmp-ansi, 7 ).