Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Reg:Displaying the particular month o... bhavana yalavarthi All Other Mainframe Topics 4 Sat Jul 08, 2017 8:13 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to Clear all TSQs during CICS sta... Hooman24 CICS 10 Mon Jun 26, 2017 9:46 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us