I would take a look at the SQL data functions. There is a DayOfWeek(Date())
function that will return 1 for Sunday and 7 for Saturday which will give
you the weekdays. There is also DayOfWeek_ISO which will return 1 for Monday
7 for Sunday.

There are probably some formulas out there to handle the others. I have
written an RPG procedure to do the DayOfWeek logic using Zeller's
congruence. That might leed you to some other forumlas.

I actually have a whole calendar prompt program I wrote, doesn't really do
anything fancy except show a subfile with the days and return the ISO date.
I think it was Booth Martin that has source to one on this site too.

You could always start at the first day of the month and increment the days
until you reach a weekend or something like that.

Just some thoughts.

--
James R. Perkins


On Thu, Mar 5, 2009 at 07:27, Ewout N Boter <ewout.boter@xxxxxxxxxx> wrote:

Hi all,

I am working on a project involving repeating dates. The user should be
able to select differents methods for specifying the dates. For example:
each second Tuesday of the month for the next 12 months. Or: the first
non-weekend day in the month for the next 18 months. For anyone familiar
with Lotus Notes: when a new meeting is created in Notes, there is a
window Repeat Options. If I could somehow copy that window, then I would
be golden.

Now, I was thinking that I am probably not the first one looking for
something like this. Therefore, I have done some searching on the
internet, but so far I have not found something useful. Hopefully, someone
on this list can point me in the right direction.

For your information: the functionality should be integrated in a
5250-application written in RPG. If there would be a utility written in
RPG, then that would be great. But it is more likely that there will be
utilities written in Java. In that case, it would be a real challenge to
integrate such a utility in the existing application, but I would
certainly give it a shot.

Thanks in advance for any suggestions.

Ewout

(This message was cross-posted in java400-l and in rpg400-l.)
--
This is the Java Programming on and around the iSeries / AS400 (JAVA400-L)
mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.



This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].