compare date



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

compare date

Postby white-shadow » Sat Jul 17, 2010 11:44 am

hi
how i will compare 2 dates taken from the system and calculate no. of daz.

thanx in advance
white-shadow
 
Posts: 12
Joined: Sat Jul 17, 2010 11:39 am
Has thanked: 0 time
Been thanked: 0 time

Re: compare date

Postby Robert Sample » Sat Jul 17, 2010 1:44 pm

Is there a question in your post somewhere? You certainly did not ask one.

And what is a "daz"? Days I've heard of. Daze I've heard of. Daisy I've heard of. But as far as I know, there is no word in the English language "daz". Terminology is critical in IT, where similar terms can have very different meanings. I strongly recommend you either use proper English when attempting to communicate or be prepared to have many problems along the way with misinterpretation.

Assuming for the moment that you actually meant "days" and assuming as well that you are using Enterprise COBOL, you can convert each date to an integer using the FUNCTION INTEGER-OF-DATE. At this point calculating days difference becomes a matter of subtraction. If you do not know about this function, find the COBOL Language Reference manual (IBM's web site would be a good place to start looking) and read up on it.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: compare date

Postby white-shadow » Sun Jul 18, 2010 12:29 am

Robert Sample wrote:Is there a question in your post somewhere? You certainly did not ask one.

And what is a "daz"? Days I've heard of. Daze I've heard of. Daisy I've heard of. But as far as I know, there is no word in the English language "daz". Terminology is critical in IT, where similar terms can have very different meanings. I strongly recommend you either use proper English when attempting to communicate or be prepared to have many problems along the way with misinterpretation.

Assuming for the moment that you actually meant "days" and assuming as well that you are using Enterprise COBOL, you can convert each date to an integer using the FUNCTION INTEGER-OF-DATE. At this point calculating days difference becomes a matter of subtraction. If you do not know about this function, find the COBOL Language Reference manual (IBM's web site would be a good place to start looking) and read up on it.
fine, your guess is right. its days and its using cobol. and thanx for your answer. the problem is solved. will have to try it practically.
thanx
white-shadow
 
Posts: 12
Joined: Sat Jul 17, 2010 11:39 am
Has thanked: 0 time
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post