The easiest ways to convert Julian date (YYYYDDD) to Gregorian equivalent is using COBOL Intrinsic functions.
Here is the function and its descriptions.
Function | Description |
DATE-OF-INTEGER | Gregorian date equivalent (YYYYMMDD) of integer date |
DAY-OF-INTEGER | Julian date equivalent (YYYYDDD) of integer date |
INTEGER-OF-DATE | Integer date equivalent of Gregorian date (YYYYMMDD) |
INTEGER-OF-DAY | Integer date equivalent of Julian date(YYYYDDD) |
*** The integer date is a seven-digit integer with a range from 1 to 3,067,671. (dates ranging from January 1, 1601 thru December 31, 9999).
The Gregorian date is obtained from the calculation (YYYY * 10,000) + (MM * 100) + DD.
o YYYY represents the year. It must be an integer greater than 1600, but not greater than 9999.
o MM represents a month and must be a positive integer less than 13.
o DD represents a day and must be a positive integer less than 32, provided that it is valid for the specified month and year combination.
The returned value of INTEGER-OF-DATE/DAY functions is an integer that is the number of days the date represented by given input, succeeds December 31, 1600 in the Gregorian calendar.
Sample Program
IDENTIFICATION DIVISION. WORKING-STORAGE SECTION. A0100-MAIN-PARA. ACCEPT WS-JULN-DATE. |
Output
Hey Guys. if my tutorial helped you please support me by liking my facebook page, sharing this webpage with your friends and commenting below. If you want me to update or add me some specific tutorial please cooment to this page or email me at shibuthannikkunnath@gmail.com
-Cheers – Shbibu Thannikkunnath
No comments:
Post a Comment