Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Is it possible to get the Weekday of a given date

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
Author Message
CJT

Active User


Joined: 02 Aug 2007
Posts: 61
Location: blore

PostPosted: Fri Sep 28, 2007 1:09 pm    Post subject: Is it possible to get the Weekday of a given date
Reply with quote

Hi,

Is it possible to get the Weekday of a given date?

I know the DATE function gives the weekday value but this works only for the current date. The requirement was to get the weekday for any given past date. Is this possible?

Thanks
Back to top
View user's profile Send private message
References
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 3169
Location: italy

PostPosted: Fri Sep 28, 2007 1:19 pm    Post subject:
Reply with quote

Check :
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IKJ3A320/4.3.16?SHELF=IKJOSE20&DT=20000113164209

regards

e.s
Back to top
View user's profile Send private message
CJT

Active User


Joined: 02 Aug 2007
Posts: 61
Location: blore

PostPosted: Fri Sep 28, 2007 1:59 pm    Post subject: Reply to: Is it possible to get the Weekday of a given date
Reply with quote

Hi, thanks for the link. But what i was looking for was something like this

Code:


DATE(,'20070925','W') -> should give me Tuesday.




But this is not working
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 3169
Location: italy

PostPosted: Fri Sep 28, 2007 2:02 pm    Post subject: Reply to: Is it possible to get the Weekday of a given date
Reply with quote

What about :

wday = date("b",yyyymmdd,"S") // 7

0 = monday
6 = sunday

thats the peculiarity of "base" date

regards

e.s
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 3169
Location: italy

PostPosted: Fri Sep 28, 2007 2:19 pm    Post subject: Reply to: Is it possible to get the Weekday of a given date
Reply with quote

Or even better

wday = date("W",yyyymmdd,"S")

regards

e.s
Back to top
View user's profile Send private message
CJT

Active User


Joined: 02 Aug 2007
Posts: 61
Location: blore

PostPosted: Fri Sep 28, 2007 3:26 pm    Post subject: Reply to: Is it possible to get the Weekday of a given date
Reply with quote

thanks a million buddy.


this worked for me perfectly fine!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1