× 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.



We have one that was written a while back.  You pass to it a MMDDYYYY
date and it returns a numeric value of the day.  You could change parm 2
to be varable DAYOFTHEWEEK to get the alpha value of the day instead of
the numeric.  Hope it works for you.

  5722WDS V5R2M0  020719                  SEU SOURCE LISTING
11/25/03 07:02:14                 PAGE    1
  SOURCE FILE . . . . . . .  DOUG/QRPGSRC
  MEMBER  . . . . . . . . .  DAYOFWK
  SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6
...+... 7 ...+... 8 ...+... 9 ...+... 0
    100
*****************************************************************
    200       * Program Name - DAYOFWK
    300       * Program Desc - Program to calculate the day of the week
and
    400       *                returns a number as follows:
    500       *                                             1=Sunday
    600       *                                             2=Monday
    700       *                                             3=Tuesday
    800       *                                             4=Wednesday
    900       *                                             5=Thursday
   1000       *                                             6=Friday
   1100       *                                             7=Saturday
   1200       * Programmer   - Brenda Morgan
   1300
*****************************************************************
   1400      D DateIn          S              8A   INZ
   1500      D P1DATEIN        S              8A
   1600      D Format          S              8A   INZ('MMDDYYYY')
   1700      D Lillian         S              8B 0 INZ
   1800      D DOW             S              8B 0 INZ
   1900      D DAYNO           S              8A
   2000      D Days            s             10a   dim(7) perrcd(7)
ctdata
   2100      D DayoftheWeek    s             10a   inz
   2200       *
   2300       * ---- Edit API Error Data Structure...
   2400      d api@err@ds      ds                  inz
   2500      d  bytes@rsvd                    9b 0
inz(%size(api@errmsg))
   2600      d  bytes@aval                    9b 0 inz
   2700      d  api@msgid#                    7a   inz
   2800      d  api@rsvrd                     1a   inz
   2900      d  api@errmsg                  100a   inz
   3000       *
   3100       * Bring in parameters from CL
   3200      C     *ENTRY        PLIST
   3300      C                   PARM                    P1DATEIN
   3400      C                   PARM                    DAYNO
   3500      C                   MOVE      P1DATEIN      DATEIN
   3600       *
   3700       *  Get lillian date - used to get day of week
   3800      C                   CALLB(d)  'CEEDAYS'
   3900      C                   PARM                    DateIn
   4000      C                   PARM                    Format
   4100      C                   PARM                    Lillian
   4200      C                   PARM                    api@err@ds
   4300       *
   4400      C                   CALLB(D)  'CEEDYWK'
   4500      C                   PARM                    Lillian
   4600      C                   PARM                    DOW
   4700      C                   PARM                    api@err@ds
   4800      C                   EVAL      DayoftheWeek = Days(DOW)
   4900      C                   MOVE      DOW           DAYNO
   5000       *
   5100      C                   MOVE      *ON           *INLR
   5200 **
   5300 Sunday    Monday    Tuesday   Wednesday Thursday  Friday
Saturday
                                   * * * *  E N D  O F  S O U R C E  * *
* *

-----Original Message-----
From: WRamos@xxxxxxxxxxxx [mailto:WRamos@xxxxxxxxxxxx] 
Sent: Monday, November 24, 2003 5:39 PM
To: MAPICS ERP System Discussion
Subject: Day of the week






Im looking to find a way to look up the day of the week using any given
date.  Does anyone have a sample routine in an RPG program that can do
this?

Thanks

_______________________________________________
This is the MAPICS ERP System Discussion (MAPICS-L) mailing list
To post a message email: MAPICS-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/mapics-l
or email: MAPICS-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/mapics-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.