View previous topic :: View next topic
|
Author |
Message |
harikumar2804
New User
Joined: 16 Nov 2008 Posts: 3 Location: Melbourne
|
|
|
|
Hi All,
I have to find the month difference between the start date and End date. Is there any function available in Cobol to find month difference ?
Example 1
Start date : 1081111 [CYYMMDD format]
End date : 1081212 [CYYMMDD format]
Expected result : 0002 [YYMM format]
The difference is one month one day, so expecting result is 0002
Example 2
Start date : 1081011 [CYYMMDD format]
End date : 1091213 [CYYMMDD format]
Expected result : 0103 [YYMM format] the difference is 1 year, 2 months, 3 days so expected result is 0103.
I want to find the month difference between these two date? Is there any function in COBOL to find out the month difference? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
COBOL has nothing completely automatic.
Does the program use db2?
You might also look into using CEEDAYS (callable service). |
|
Back to top |
|
|
harikumar2804
New User
Joined: 16 Nov 2008 Posts: 3 Location: Melbourne
|
|
|
|
Thanks. But I am not using DB2 and I tried using project specific Date routine to find the difference. No luck.
I am trying to write my own logic to find the difference.
Regards,
H |
|
Back to top |
|
|
|