IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

The Month difference bw the start date and end date


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
harikumar2804

New User


Joined: 16 Nov 2008
Posts: 3
Location: Melbourne

PostPosted: Thu Nov 27, 2008 7:45 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Nov 27, 2008 9:35 am
Reply with quote

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
View user's profile Send private message
harikumar2804

New User


Joined: 16 Nov 2008
Posts: 3
Location: Melbourne

PostPosted: Thu Nov 27, 2008 11:42 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Need to convert date format DFSORT/ICETOOL 20
Search our Forums:

Back to Top