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

Find the month difference bw the start date and stop date


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

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Fri Oct 27, 2006 3:06 pm
Reply with quote

Hi All,
I have to find the month difference between the start date and stop date(for example). How can I do that? Is there any function to use that in COBOL? Elaborately :-
For example, I am having start date as 10/27/06 and end date as 08/31/08. Now 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
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Fri Oct 27, 2006 6:14 pm
Reply with quote

Hi There,

www.titusinformationsystems.com/MAIN/VAsoLbQ.htm

This will be useful.Here DATEDF is the function by which u can get differnce in month in RESULT-MONTHS argument.


Hope it will helpful
Back to top
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Mon Oct 30, 2006 10:09 am
Reply with quote

Hi Guptae,
Thanx for your help. Actually I wanted to know if there is any in-built function or so to calcualte the month difference between two dates provided. However we have done that by using the following DB2 call like -
Code:

SELECT                                                 
       (YEAR(CURRENT_DATE) - YEAR('2000-12-20')) * 12  +
       MONTH(CURRENT_DATE) - MONTH('2000-12-20')       
FROM SYSIBM.SYSDUMMY1                                   
;                                                       


I think this will help you all if you faced the situation like me.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Mon Oct 30, 2006 1:38 pm
Reply with quote

Hi Amitava,

If u want it through then why u posted this question on COBOL forum?
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Mon Oct 30, 2006 1:38 pm
Reply with quote

Hi Amitava,

If u want it through db2 then why u posted this question on COBOL forum?
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 To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top