Page 1 of 2

Julian Date difference

PostPosted: Sun Jun 10, 2012 6:14 am
by dip111188
canu anybody provide me the exact code to find the differene between two given joulian foramt date,without using the integer-of-date function, it's very urgent please help!!!!!!!

Re: Julian Date difference

PostPosted: Sun Jun 10, 2012 7:32 am
by Robert Sample
Your dates are high year / high days, low year / low days. The algorithm -- which anyone who has passed high school algebra should be able to figure out - - is:

1. Subtract low days from high days. If result is negative, add 365 to results and subtract 1 from high year.
2. Subtract low year from high year. Multiply result by 365.25 and add to days difference. This will give you difference between high date and low date.

Adjusting this calculation for leap years, I leave for you to figure out.

Re: Julian Date difference

PostPosted: Sun Jun 10, 2012 7:46 am
by dick scherrer
Hello and welcome to the forum,

When you have a new question, you should start a new topic rather tha reply to some existing topic.

Just curious, why Not use the COBOL internal functions?

If this is a school exercise, this should be mentioned.

Re: Julian Date difference

PostPosted: Sun Jun 10, 2012 2:23 pm
by NicC
I could give you the answer but... we do not do urgent as a forum is not the place for urgent. We do as and when and if we want. For urgent you have to pay someone.

Re: Julian Date difference

PostPosted: Sun Jun 10, 2012 9:43 pm
by dip111188
This is not a school problem, and the thing is that in my client mainframe the cobol internal function is not working,if it would have worked there is no use of posting this query,and talking about urgency I know it very well for urgent case every body need to pay,but the thing is that in forums people only share knowledge,but that don't work here I think,the thing is that here only money matters because there is no proper reply to my question except some worthless suggestion........

Re: Julian Date difference

PostPosted: Sun Jun 10, 2012 11:46 pm
by Robert Sample
there is no proper reply to my question
You are given the exact algorithm to use, and you call it a "worthless suggestion"?

Perhaps you should find a career other than IT, since it is obvious that you are NOT well suited to do ANYTHING related to a computer. If you do not understand algorithms, then you cannot program a computer and hence you should NOT be doing IT activities, especially related to COBOL which requires a good understanding of algorithms.

Re: Julian Date difference

PostPosted: Mon Jun 11, 2012 6:01 am
by dick scherrer
Hello,

Other than the leap year calculation, what did you not understand about the suggestion Robert provided?

If you had bothered to mention you did not want to use the internal function because it does not work on your current compiler, you would have helped yourself. This is what teachers often ask of students so they will learn what the function is doing internally.

Unlike Many of the amatuer forums about, we want to help people learn, not do their work for them. . . We are willing to work thru problems with people so they Can learn.

The better you present your question, the more useful the replies.

Re: Julian Date difference

PostPosted: Mon Jun 11, 2012 6:03 am
by dip111188
By telling "worthless suggestion" it was intended to NicC not to you, if you do not understand........ Robert Sample..

Re: Julian Date difference

PostPosted: Mon Jun 11, 2012 6:11 am
by dick scherrer
Hello,

if you do not understand........ Robert Sample..
I have no idea what this is telling me/us :?

If you work on how you present ideas, you will cause less confusion. We can possibly help with this also.

Re: Julian Date difference

PostPosted: Mon Jun 11, 2012 9:24 am
by Anuj Dhawan
Possibly, start with what you've tried and then there might be further suggestion/s, dip111188.

PS. : It's tough to start with Mondays these days! :wink: