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
 
Regarding Date Comparison

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
prashantshinde

New User


Joined: 25 Nov 2005
Posts: 44
Location: Pune

PostPosted: Thu Sep 28, 2006 6:16 pm    Post subject: Regarding Date Comparison
Reply with quote

I have two dates in MMDDYYYY.
I want to calculate the difference in Days of these two dates.
Is there any function/utility/tool to calculate this difference instead of writing the new code for it.
Back to top
View user's profile Send private message

UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 757
Location: Germany

PostPosted: Thu Sep 28, 2006 7:03 pm    Post subject:
Reply with quote

Hi !

If you're having DB2 installed in your environment an you are used to it,
you could do tis by using DB2-Command in Programm.

Regards, UmeySan
Back to top
View user's profile Send private message
chandru_g

New User


Joined: 07 Mar 2006
Posts: 5

PostPosted: Thu Sep 28, 2006 9:19 pm    Post subject: Re: Regarding Date Comparison
Reply with quote

There is no function in COBOL to do this.... we will have to implement this in the program!
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Thu Sep 28, 2006 10:55 pm    Post subject: Re: Regarding Date Comparison
Reply with quote

You can check out this link in the cobol manual INTEGER-OF-DATE

You will have to convert the date from MMDDYYYY to YYYYMMDD, but this should be simple. Get the Integer of date for both dated and subtract.

Dave
Back to top
View user's profile Send private message
prashantshinde

New User


Joined: 25 Nov 2005
Posts: 44
Location: Pune

PostPosted: Fri Sep 29, 2006 10:31 am    Post subject:
Reply with quote

Dave,

Thanks.

It would be better if you give one example of how to use the
Function INTEGER-OF-DATE in the program
Back to top
View user's profile Send private message
guptae

Moderator


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

PostPosted: Fri Sep 29, 2006 10:40 am    Post subject:
Reply with quote

Hi Prashanth,

INTEGER-OF-DATE Returns INTEGER equivalent of Gregorian date passed.

MOVE FUNCTION INTEGER-OF-DATE (your-julian-date in yyyymmdd format of first date ) TO WS-DATE1

MOVE FUNCTION INTEGER-OF-DATE (your-julian-date in yyyymmdd format of Second date ) TO WS-DATE2

COMPUTE DATDIFF = WS-DATE2-WS-DATE1

Hope it will helpful
Back to top
View user's profile Send private message
prashantshinde

New User


Joined: 25 Nov 2005
Posts: 44
Location: Pune

PostPosted: Fri Sep 29, 2006 10:53 am    Post subject:
Reply with quote

Ekta,

Thanks for Immediate help.
Back to top
View user's profile Send private message
guptae

Moderator


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

PostPosted: Fri Sep 29, 2006 11:31 am    Post subject:
Reply with quote

Prashanth,

Glad I could help You
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 Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm

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