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 

Built-in Function for Calculating the number of days in REXX

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


Joined: 07 Jan 2005
Posts: 2
Topics: 1
Location: New Delhi

PostPosted: Fri Jan 07, 2005 2:05 am    Post subject: Built-in Function for Calculating the number of days in REXX Reply with quote

Hi! All,
Is there any built-in function to calculate the number of days in a particular year? I want to give the date as input.For example,if I am giving 25/01/2005 as input,that function should return '25' days as result.
_________________
Thanks & Rgds,
EBP
Back to top
View user's profile Send private message Yahoo Messenger
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Fri Jan 07, 2005 2:17 am    Post subject: Reply with quote

ebp,

Please be clear in your question.
Code:

number of days in a particular year

No. of days may be 365 / 366 depending whether the year is a normal year or leap year. Is this what you want ? But your example says:

Code:

25/01/2005 as input,that function should return '25' days as result.

'25' days - do u want to strip off only the date portion from the 'dd/mm/yyyy' input ? In that case you can use SUBSTR(date_text, 1, 2) or LEFT(date_text, 2) to get the date portion alone.

Thanks,
Phantom
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Jan 07, 2005 6:29 am    Post subject: Reply with quote

ebp,

Check this link for some functions on date

http://www.mvsforums.com/helpboards/viewtopic.php?t=228&highlight=rexi

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ebp
Beginner


Joined: 07 Jan 2005
Posts: 2
Topics: 1
Location: New Delhi

PostPosted: Sun Jan 09, 2005 3:12 am    Post subject: Reply with quote

Hi!
Thanks a lot for you all.But, the think is that I need to calculate the number of days from the 1st of Jan to that particular date.For, example, if the input=13/02/2005 then the result should be "44" (31+13) days.I think that my previous post is not clear to you all.Now,I hope that you can understand my question.
In the date function, DATE(d) calculates only for the system date.But, I need to give the date as input.

With Best Regards,
EBP.
Back to top
View user's profile Send private message Yahoo Messenger
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Sun Jan 09, 2005 7:24 am    Post subject: Reply with quote

ebp,

I think DATE(d, input_date) could be used to get the no. of days since the given input date. I'm not sure. I didn't test this but the manual DOES NOT tell that this is impossible.

Code:

DATE('D', '15 Jan 2004')


http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IKJ4A330/4.3.16?DT=20020521161835

The manual clearly says that the input_date should not be given for 'Century - C' & 'Julian - J' formats but it doesn't say so for 'Days - D' option. So, try and let us know if this works.

Thanks,
Phantom
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Jan 10, 2005 9:06 am    Post subject: Reply with quote

ebp,

You can use Date D for any given date.

try this

Code:

/* REXX */                         
MYDATE = 20041012   /*CCYYMMDD */ 
DAYOFYEAR=DATE('D',MYDATE,'S')     
SAY DAYOFYEAR                     


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
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