Page 1 of 1

Date conversion in REXX.

Posted: Fri Feb 05, 2016 2:38 pm
by Mukesh Chhabra
Hi,

I think I could make it to work and I am not able to understand the REXX manuals on how to convert the dates using DATE function. I can have a date of nature 2015010 and it needs to be displayed as as Jan 10, 2015 or 2015 Jan 10. Should I need to translate the 2015010 to 20150110 first? I can also have dates like 2016.031.

And if you can guide me to a document on how to use the DATE function in REXX in a good way, it'll be a great help.

Thanks

Re: Date conversion in REXX.

Posted: Fri Feb 05, 2016 3:47 pm
by enrico-sorichetti
seems pretty straightforward for me

the date function accepts up to three parameters

output_date = DATE(output_format, input_date, input_format)

the formats are explained in the manuals

the small complication for the J format is that YYYYDDD is not supported directly and You will have to use YYDDD
- small problem anyway , a substr will take care of it

Re: Date conversion in REXX.

Posted: Tue Feb 09, 2016 2:06 pm
by Mukesh Chhabra
ok, thanks enrico.