Julian Date difference



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Julian Date difference

Postby dip111188 » Sun Jun 10, 2012 6:14 am

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!!!!!!!
dip111188
 
Posts: 3
Joined: Thu May 31, 2012 9:55 am
Has thanked: 0 time
Been thanked: 0 time

Re: Julian Date difference

 

Re: Julian Date difference

Postby Robert Sample » Sun Jun 10, 2012 7:32 am

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.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Julian Date difference

Postby dick scherrer » Sun Jun 10, 2012 7:46 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Julian Date difference

Postby NicC » Sun Jun 10, 2012 2:23 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Julian Date difference

Postby dip111188 » Sun Jun 10, 2012 9:43 pm

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........
dip111188
 
Posts: 3
Joined: Thu May 31, 2012 9:55 am
Has thanked: 0 time
Been thanked: 0 time

Re: Julian Date difference

Postby Robert Sample » Sun Jun 10, 2012 11:46 pm

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.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Julian Date difference

Postby dick scherrer » Mon Jun 11, 2012 6:01 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Julian Date difference

Postby dip111188 » Mon Jun 11, 2012 6:03 am

By telling "worthless suggestion" it was intended to NicC not to you, if you do not understand........ Robert Sample..
dip111188
 
Posts: 3
Joined: Thu May 31, 2012 9:55 am
Has thanked: 0 time
Been thanked: 0 time

Re: Julian Date difference

Postby dick scherrer » Mon Jun 11, 2012 6:11 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Julian Date difference

Postby Anuj Dhawan » Mon Jun 11, 2012 9:24 am

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:
Anuj
Anuj Dhawan
 
Posts: 274
Joined: Mon Feb 25, 2008 3:53 am
Location: Mumbai, India
Has thanked: 6 times
Been thanked: 4 times

Next

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post