MainframeSupports
tip week 16/2010:

Many dates in different products on the mainframe is stored and showed as julian dates in the format YYDDD where YY is the year and DDD is the day number in the year. In January it is quite easy to translate a julian date into an ordinary date, but as the year passes it becomes increasingly difficult. Fortunately the DATE function in REXX is able to help you.

I hope you long ago implemented my simple calculator, because you can use it to translate a julian date to a date in day, month and year format. If you like I have named the calculator SAY as I did you are able to translate day 100 in year 2010 using the command TSO SAY DATE('S','10100','J'). The result is written in the format YYYYMMDD. In a REXX program you just have to code SAY 'DATE(YYYYMMDD)='DATE('S','10100','J')

Most REXX programmers uses DATE to determine the current date which REXX is able to return in many different formats, but as you have just seen the DATE function is able to convert from one date format to another. The first parameter specifies the format that DATE translates to, the second parameter specifies the date and the third parameter specifies the format of the second parameter. Unfortunately DATE cannot translate from day, month and year to a julian date (quite annoying). Instead you can translate from day, month and year to the day number in the year using DATE('D','20100514','S').

Previous tip in english        Sidste danske tip        Tip list