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
 

 

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 Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Overlay the system date Danielle.Filteau SYNCSORT 4 Fri Mar 03, 2017 1:16 am
No new posts Checking Current date vickey_dw DFSORT/ICETOOL 1 Wed Feb 08, 2017 11:14 pm


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