MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to get last day's date of a month?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
VdeepakG
Beginner


Joined: 07 Nov 2016
Posts: 4
Topics: 2

PostPosted: Sat Feb 25, 2017 1:31 pm    Post subject: How to get last day's date of a month? Reply with quote

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
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Sat Feb 25, 2017 6:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
VdeepakG
Beginner


Joined: 07 Nov 2016
Posts: 4
Topics: 2

PostPosted: Sun Feb 26, 2017 1:21 am    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Sun Feb 26, 2017 4:59 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12358
Topics: 75
Location: San Jose

PostPosted: Sun Feb 26, 2017 12:34 pm    Post subject: Re: How to get last day's date of a month? Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group