Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
The Month difference bw the start date and end date

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: The Month difference bw the start date and end date
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

Site Director


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

PostPosted: Thu Nov 27, 2008 9:35 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Creating ISPF Screens with Scrname vi... Albireo20 TSO/ISPF 9 Tue Sep 05, 2017 4:24 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us