View previous topic :: View next topic |
Author |
Message |
VdeepakG Beginner
Joined: 07 Nov 2016 Posts: 4 Topics: 2
|
Posted: Sat Feb 25, 2017 1:31 pm Post subject: How to get last day's date of a month? |
|
|
Hi,
Can we get last day's date of a month irrespective of the day we run the code, through any REXX built-in functions? If so can anyone share the code
Thanks
Deepak |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Sat Feb 25, 2017 6:57 pm Post subject: |
|
|
Assuming that you want the day name (Sunday-Saturday) then read about the Date builtin function. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
VdeepakG Beginner
Joined: 07 Nov 2016 Posts: 4 Topics: 2
|
Posted: Sun Feb 26, 2017 1:21 am Post subject: |
|
|
Nic Clouston,
No, i want the date of the month which it ended.
For Ex: today is Feb 26,2017. If i Run the code it should give 28th Feb 2017
Thanks for response |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Sun Feb 26, 2017 4:59 am Post subject: |
|
|
Use the DATE function to return either the month name or todays date from which you can extract the month number. Use either to index into a stem of days in month (which you would have to adjust for leap year i.e. if a leap year add one to the base february value (28)). All standard programming. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12359 Topics: 75 Location: San Jose
|
Posted: Sun Feb 26, 2017 12:34 pm Post subject: Re: How to get last day's date of a month? |
|
|
VdeepakG wrote: | Hi,
Can we get last day's date of a month irrespective of the day we run the code, through any REXX built-in functions? If so can anyone share the code
Thanks
Deepak |
If DFSORT is an option you can use LASTDAYM which will return the last of the month irrespective of when your job runs
check this link (PDF at the bottom)
http://www-01.ibm.com/support/docview.wss?rs=114&uid=isg3T7000242 _________________ Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
|
|