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
 
Find the month difference bw the start date and stop date

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Find the month difference bw the start date and stop date
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: 1187
Location: Bangalore,India

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

Hi There,

http://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    Post subject:
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: 1187
Location: Bangalore,India

PostPosted: Mon Oct 30, 2006 1:38 pm    Post subject:
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: 1187
Location: Bangalore,India

PostPosted: Mon Oct 30, 2006 1:38 pm    Post subject:
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    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 8 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