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
 

 

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: 743
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 TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts CICS NEW SIT PARAMETERS CICS BEHAVIOR... Kyle Carroll CICS 0 Fri Nov 04, 2016 11:55 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm


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