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 

Conversion of date format using 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
psridhar
Beginner


Joined: 16 May 2004
Posts: 68
Topics: 26

PostPosted: Mon Feb 06, 2006 6:36 am    Post subject: Conversion of date format using REXX... Reply with quote

Hi

I have my date as year and no of days in that year as below.

Year : 2005
No of days in that year : 306

Is there a way to convert this in to DD.MM.YYYY format...

For the above example, output should be 02.11.2005

Thanks in advance
Sridhar P
Back to top
View user's profile Send private message
ofer71
Intermediate


Joined: 12 Feb 2003
Posts: 358
Topics: 4
Location: Israel

PostPosted: Mon Feb 06, 2006 8:14 am    Post subject: Reply with quote

Here is an example:
Code:
/* rexx */                                           
                                                     
MYYEAR = 2006                                         
MYDAY  = 36                                           
                                                     
SAY DATE('E',SUBSTR(MYYEAR,3,2)RIGHT(MYDAY,3,'0'),'J')
                                                     
EXIT                                                 


O.
________
Ford Essex V6 engine history


Last edited by ofer71 on Sat Feb 05, 2011 11:30 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
psridhar
Beginner


Joined: 16 May 2004
Posts: 68
Topics: 26

PostPosted: Mon Feb 06, 2006 12:56 pm    Post subject: Reply with quote

Hi Friend,

Thanks for the info. It solved my purpose.

Regards
Sridhar P
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Mon Feb 06, 2006 2:10 pm    Post subject: Reply with quote

As a review, the DATE function used in this manner is specified as:

DATE(date_format1 , input_date , date_format2)

where

date_format1 is the format of the date you wish to convert to.
input_date is the date value.
date_format2 is the format of the input_date.
Back to top
View user's profile Send private message
robr
Beginner


Joined: 28 Apr 2006
Posts: 2
Topics: 0

PostPosted: Wed Jun 27, 2007 12:44 pm    Post subject: Reply with quote

To reactivate this old thread, why do I get "Incorrect call to routine" for this:

say date("J","31/12/99","E")

I hope to see 99365.
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Wed Jun 27, 2007 1:03 pm    Post subject: Reply with quote

See the note on the use of DATE(J):

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IKJ4A360/4.3.16?DT=20050714012324
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Jun 27, 2007 1:12 pm    Post subject: Reply with quote

robr,

The error is because when Julian is used for date_format1, this option is valid only when input_date is not specified.

Try this
Code:

SAY SUBSTR('31/12/99',7,2)|| DATE('D','31/12/99','E')


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


Joined: 28 Apr 2006
Posts: 2
Topics: 0

PostPosted: Wed Jun 27, 2007 2:49 pm    Post subject: Reply with quote

Thx, I assume that means that the only solution is to create a separate routine to calculate the Julian date myself Crying or Very sad
One wonders why the date function has such a strange restriction...
Back to top
View user's profile Send private message
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