Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to Get weekday for a particular Date

133 views
Skip to first unread message

Hiren Chandrakant Shah

unread,
Nov 16, 2004, 11:42:05 PM11/16/04
to
Hi all,

Can anyone tell me how get which weekday it is for a given date through
SQL query or any other way.
Thanks in advance..

Hiren Chandrakant Shah.
Infosys Technologies Ltd.,
Bangalore - 560100.
cell : (+91) 94485 24261.

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX

Ravikiran K N

unread,
Nov 17, 2004, 12:42:32 AM11/17/04
to
Hi,
U can use NDR Date routine NDR1215 to get the particular week day

Regards
Ravi
CGI

Paul A Redhead

unread,
Nov 17, 2004, 1:18:36 AM11/17/04
to
Hiren,
You could use the following SQL:

SELECT CURRENT_DATE AS "CURRENT DATE",
CASE DAYS(CURRENT_DATE) - ((DAYS(CURRENT_DATE)/7)*7) + 1
WHEN 1 THEN 'SUNDAY'
WHEN 2 THEN 'MONDAY'
WHEN 3 THEN 'TUESDAY'
WHEN 4 THEN 'WEDNESDAY'
WHEN 5 THEN 'THURSDAY'
WHEN 6 THEN 'FRIDAY'
WHEN 7 THEN 'SATURDAY'
ELSE 'ERROR'
END AS "DAY OF THE WEEK"
FROM SYSIBM.SYSDUMMY1


Paul.


Hiren Chandrakant
Shah
<Hiren_Shah02@INF To
OSYS.COM> TSO-...@VM.MARIST.EDU
Sent by: TSO REXX cc
Discussion List
<TSO-...@VM.MARI Subject
ST.EDU> How to Get weekday for a particular
Date

17/11/2004 02:40
PM


Please respond to
TSO REXX
Discussion List
<TSO-...@VM.MARI
ST.EDU>


Hi all,

************************************************************
Opinions contained in this e-mail do not necessarily reflect
the opinions of the Queensland Department of Main Roads,
Queensland Transport or Maritime Safety Queensland, or
endorsed organisations utilising the same infrastructure.
If you have received this electronic mail message in error,
please immediately notify the sender and delete the message
from your computer.
************************************************************

Daniel Vonrueti

unread,
Nov 17, 2004, 2:47:04 AM11/17/04
to
with an other way you mean REXX I suppose:

SAY DATE('W',04322,'J')
SAY DATE('W','17/11/04','E')


If you have an other date-format look at the function DATE.

Daniel


Hiren Chandrakant Shah <Hiren_...@INFOSYS.COM>
Sent by: TSO REXX Discussion List <TSO-...@VM.MARIST.EDU>
17.11.2004 05:40


Please respond to
TSO REXX Discussion List <TSO-...@VM.MARIST.EDU>


To
TSO-...@VM.MARIST.EDU
cc

Subject


How to Get weekday for a particular Date


Hi all,

*****Disclaimer*****
This message is for the addressee only and may contain confidential or privileged information. You must delete and not use it if you are not the intended recipient. It may not be secure or error-free. All e-mail communications to and from the Julius Baer Group may be monitored. Processing of incoming e-mails cannot be guaranteed. Any views expressed in this message are those of the individual sender. This message is for information purposes only. All liability of the Julius Baer Group and its entities for any damages resulting from e-mail use is excluded. US persons are kindly requested to read the important legal information presented at following URL: http://www.juliusbaer.com/maildisclaimer

Dave Salt

unread,
Nov 17, 2004, 8:47:50 AM11/17/04
to
Hiren,

You can pass a STANdard date in YYYYMMDD format and REXX will give you back
the day of the week:

say date("WEEKDAY","20040315","STAN")

Returns "Monday".

Hope that helps,

Dave Salt
Soft-Center Solutions Inc.
http://www.soft-center.com
1-877-SoftCen
Bringing you SimpList(tm) - The easiest, most powerful way to surf a
mainframe!

Isaac Yassin

unread,
Nov 17, 2004, 10:45:53 AM11/17/04
to
Hi,
From V7 you can use the DAYOFWEEK function (1 - Sunday, 2- Monday, etc. )
There's no need for the calculation.

Isaac Yassin

0 new messages