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



Hey:

Simplest might be the following ILE CL procedure:

/* From an input date (DDMMYY), the day of the week is calculated   */
/*   and returned to the caller...                                  */

pgm    ( +
         &Date        +
         &DayWk       +
       )

   dcl   &Date          *char        6
   dcl   &DayWk         *char       10


   dcl   &RtnVal1       *char        4
   dcl   &Pic           *char        6   value( 'DDMMYY' )

   callprc      CEEDAYS      ( +
                               &Date          +
                               'DDMMYY'       +
                               &RtnVal1       +
                               *omit          +
                             )
   callprc      CEEDATE      ( +
                               &RtnVal1       +
                               'Wwwwwwwww'    +
                               &DayWk         +
                               *omit          +
                             )


Exit:

   return

endpgm

An example of calling this is:

pgm

   dcl   &Date          *char        6   value( '270203' )
   dcl   &DayWk         *char       10   value( '*NONE     ' )

   callprc DAYWK      ( +
                        &Date        +
                        &DayWk       +
                      )

dmpclpgm

   return

endpgm

Note that the input picture string is a constant 'DDMMYY' but could easily be 
passed in as another parm. Likewise the output picture is 'Wwwwwwwww' but can 
also be set as you wish. Lots of flexibility. These CEE* APIs are shown in ILE 
CL but could be used in ILE RPG almost as simply. Picture string characters are 
described along with details about the CEE* Date and Time APIs in the CEE* APIs 
guide.

If you _must_ use OPM, then the Convert Date and Time Format (QWCCVTDT) API can 
be used. It usually must be called twice -- once to convert to the *DTS
format and then to convert *DTS into the *DOS format. The *DOS format includes 
a one-byte binary value ranging from 0 thru 6 which corresponds to Sunday thru 
Saturday. Still pretty easy but takes some getting used to. This is documented 
in the Miscellaneous APIs guide.

Tom Liotta


rpg400-l-request@xxxxxxxxxxxx wrote:

>   3. Day of the Week (Hey Dac !!!)
>
>Is there a tool or a way in which i can determine the day of the week of the 
>given date?

-- 
-- 
Tom Liotta
The PowerTech Group, Inc.
19426 68th Avenue South
Kent, WA 98032
Phone  253-872-7788 x313
Fax    253-872-7904
http://www.powertechgroup.com


__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! 
http://channels.netscape.com/ns/browsers/download.jsp 

Get your own FREE, personal Netscape Mail account today at 
http://webmail.netscape.com/

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.