Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Julian Date

Status
Not open for further replies.

rsims

Programmer
Sep 25, 2000
12
US
How do I convert a Julian date into a calendar date?
Like MMDDCCYY or Month Day, Century Year.
 
Hi R,

The most recent versions of COBOL use "intriinsic functions", the most handy of which are the date functions. If you have a COBOL manual or book, look in the index.

Regards, Jack.
 
Hi again R,

I did some research and It's more complicated than I first thought. Here's the way to do it:

Get your date field into this format:
05 WS-Y4DDD PIC X(007).

Receiving field:
05 WS-Y4M2D2 PIC X(008).


COMPUTE WS-Y4M2D2 = FUNCTION DATE-OF-INTERGER
(FUNCTION INTERGER-OF-DAY
(WS-Y4DDD))

Now you can reformat the result field to MMDDYYYY.

HAVEN'T TESTED THIS, BUT IT SHOULD WORK.

Regards, Jack.




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top