+ Reply to Thread
Results 1 to 3 of 3

Thread: How can I determine what week of the month it is

  1. #1
    EDIguru Guest

    Default How can I determine what week of the month it is

    I know I can determine from a CL what day of the week it is, for instance *SAT by using RTVSYSVAL QDAYOFWEEK. Is there any way in RPG (or CL for that matter), to determine if a given Saturday is the 1st, 2nd, 3rd, etc. Saturday of the current month? I have a job that I currently run for an application on the 2nd Saturday of the month from Robot. I would like to modify my process so that I can run it for other apps on every Saturday of the month and handle the run/don't run option with my code, rather than having Robot do that. I am trying to make the process non-application specific.

  2. #2

    Default Re:How can I determine what week of the month it i

    Add 6 to the day, divide by 7. The integer dividend gives you the occurrence for that day-of-week. If you're days 1 to 7, you're the first of that particular day-of-week. If you're in days 8 to 14, you're the second. Joe

  3. #3
    EDIguru Guest

    Default Re:How can I determine what week of the month it is

    Yeah, thanks. I should have updated this, but forgot I posted it. I figured it out, not quite the same as yours, but it works.

+ Reply to Thread

Similar Threads

  1. determine day of week
    By Guest.Visitor in forum General
    Replies: 0
    Last Post: 11-22-2002, 12:26 PM
  2. determine day of week
    By Guest.Visitor in forum Web Languages
    Replies: 3
    Last Post: 11-22-2002, 12:26 PM
  3. TechTip: Schedule Jobs by Day of Week of Month
    By Guest.Visitor in forum RPG
    Replies: 1
    Last Post: 08-06-2002, 12:29 AM
  4. Determine Day of Week in RPG
    By Guest.Visitor in forum Application Software
    Replies: 11
    Last Post: 10-03-2000, 10:27 AM
  5. Last Day of Month
    By Guest.Visitor in forum Application Software
    Replies: 3
    Last Post: 08-11-1999, 12:36 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