View previous topic :: View next topic
|
Author |
Message |
prashantshinde
New User
Joined: 25 Nov 2005 Posts: 49 Location: Pune
|
|
|
|
I have two dates in MMDDYYYY.
I want to calculate the difference in Days of these two dates.
Is there any function/utility/tool to calculate this difference instead of writing the new code for it. |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Hi !
If you're having DB2 installed in your environment an you are used to it,
you could do tis by using DB2-Command in Programm.
Regards, UmeySan |
|
Back to top |
|
|
chandru_g
New User
Joined: 07 Mar 2006 Posts: 5
|
|
|
|
There is no function in COBOL to do this.... we will have to implement this in the program! |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
You can check out this link in the cobol manual INTEGER-OF-DATE
You will have to convert the date from MMDDYYYY to YYYYMMDD, but this should be simple. Get the Integer of date for both dated and subtract.
Dave |
|
Back to top |
|
|
prashantshinde
New User
Joined: 25 Nov 2005 Posts: 49 Location: Pune
|
|
|
|
Dave,
Thanks.
It would be better if you give one example of how to use the
Function INTEGER-OF-DATE in the program |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Prashanth,
INTEGER-OF-DATE Returns INTEGER equivalent of Gregorian date passed.
MOVE FUNCTION INTEGER-OF-DATE (your-julian-date in yyyymmdd format of first date ) TO WS-DATE1
MOVE FUNCTION INTEGER-OF-DATE (your-julian-date in yyyymmdd format of Second date ) TO WS-DATE2
COMPUTE DATDIFF = WS-DATE2-WS-DATE1
Hope it will helpful |
|
Back to top |
|
|
prashantshinde
New User
Joined: 25 Nov 2005 Posts: 49 Location: Pune
|
|
|
|
Ekta,
Thanks for Immediate help. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Prashanth,
Glad I could help You |
|
Back to top |
|
|
|