× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



http://www.as400pro.com/TipsRPG.htm

There are several examples of how to calculate the difference in "working
days" examples at this link.

Michael

-----Original Message-----
From: Angela Wawrzaszek [mailto:awawrzaszek@nucorauburn.com]
Sent: March 11, 2002 11:40 AM
To: M Fraser; midrange-L@midrange.com
Subject: RE: RPGIV: work days in a subdur


Yes and no this is what will work.  I will be subtracting dates that can be
1-120 days apart.  So to figure out which day of the week it is and subtract
a weekend is not quite that simple.   I wuld need to be able to know how
many weekends to subtract out of the subdur.

-----Original Message-----
From: M Fraser [mailto:mfraser@ssica.com]
Sent: Fri 3/8/2002 5:55 PM
To: Angela Wawrzaszek
Cc:
Subject: Fw: RPGIV: work days in a subdur


        it doesn't look like my email was sent... so I'm forwarding you what
I sent to the group.  hope it helps.
        ----- Original Message -----
        From: M Fraser <mailto:mfraser@ssica.com>
        To: RPGIV@yahoogroups.com
        Sent: Friday, March 08, 2002 2:23 PM
        Subject: Re: RPGIV: work days in a subdur

        Angela,
        this is from the RPG group's old emails (from last year!), I'm
guessing this should work well for you.

        ----- Original Message -----
        From: Bob Cozzi (RPGIV) <mailto:cozzi@rpgiv.com>
        To: RPGIV@yahoogroups.com
        Sent: Monday, June 04, 2001 7:55 AM
        Subject: RE: [RPGIV] Dates

        Here’s the source for the GetDay() procedure:

.....D*ame+++++++++++EUDS.......Length+TDc.Functions++++++++++++++++++++++++
+++
             D GetDay          PR            10I 0
             D  InputDate                      D   CONST DATFMT(*ISO)


.....P*rocName+++++++..B...................Functions++++++++++++++++++++++++
+++
             P GetDay          B                   EXPORT
              ** Procedure interface for DayOfWeek function

.....D*ame+++++++++++EUDS.......Length+TDc.Functions++++++++++++++++++++++++
+++
             D DayOfWeek       PI            10I 0
             D  InputDate                      D   CONST DATFMT(*ISO)
             ** Base date is based on calendar changed date
             D BaseDate        S               D   Static INZ(D'1582-10-14')
             D nDayOfWeek      S             10I 0
             D nDays           S             10I 0

.....C*Rn01Factor1+++++++OpCode(ex)Factor2+++++++Result++++++++Len++DcHiLoEq
             C                   TEST(E)                 InputDate
             C                   If        %ERROR
             C                   Return    -1
             C                   Endif
             C     InputDate     SubDur    BaseDate      nDays:*DAYS

             C                   CALLB     'CEEDYWK'
             C                   Parm                    nDays
             C                   Parm                    nDayofWeek

             C                   return    nDayOfWeek

             PGetDay           E



        Bob Cozzi
        cozzi@rpgiv.com

        -----Original Message-----
        From: Bob Cozzi (RPGIV) [mailto:cozzi@rpgiv.com]
        Sent: Monday, June 04, 2001 10:45 AM
        To: RPGIV@yahoogroups.com
        Subject: RE: [RPGIV] Dates

        I think you’ve answered your own question. Just do the SUBDUR or
ADDDUR operation, and then if the result is a weekend, subtract a day or two
from the date. You can use the GetDay() procedure I wrote to get the day of
the week after you’re calculation is done.

        Date1 subdur Duration:*DAYS  newDate
                  Select
                  When   GetDay(NewDate)=1
                  SubDur  2:*Days           NewDate
                  When  GetDay(NewDate)=7
                  SubDur  1:*Days           NewDate
                  EndSel

        Bob Cozzi
        cozzi@rpgiv.com

        -----Original Message-----
        From: btrisko@douglas-machine.com
[mailto:btrisko@douglas-machine.com]
        Sent: Monday, June 04, 2001 10:28 AM
        To: RPGIV@yahoogroups.com
        Subject: [RPGIV] Dates


        I am just starting to use the date operations in RPGIV and need some
help.

        I need to subtract 4 days from a user entered date, but the date
calculated
        must fall on a weekday.

        For example: If the date entered is 06-13-01 and subtract 4 days
from this
        will give me 06-10-01 which is a Sunday, I need to make this date
become
        06-08-01 which is Friday.

        I need to get this procedure done quite soon, so any help forwarded
would
        be appreciated.

        Thanks in advance.

        Brenda Trisko
        Douglas Machine, Inc.
        Alexandria, MN
_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
or email: MIDRANGE-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

This mailing list archive is Copyright 1997-2024 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].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.