IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to check a date is falling in between two given dates


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sm_2009

New User


Joined: 10 May 2009
Posts: 72
Location: bangalore

PostPosted: Wed May 20, 2009 6:57 pm
Reply with quote

hi

i need to check input date in file is falling between two given dates.

pls suggest

thanks
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed May 20, 2009 7:10 pm
Reply with quote

NOTEB: Between means inclusive of lower and higher value.


If input-date GTEQ lower-given-date
and input-date LTEQ higher-given-date
then
the input-date falls between the two given dates.
Back to top
View user's profile Send private message
sm_2009

New User


Joined: 10 May 2009
Posts: 72
Location: bangalore

PostPosted: Wed May 20, 2009 7:17 pm
Reply with quote

wht is the format you suggest?

all dates are pic x(10) yyyy-mm-dd
will it work this format?

pls suggest
Back to top
View user's profile Send private message
star_dhruv2000

New User


Joined: 03 Nov 2006
Posts: 87
Location: Plymouth, MN USA

PostPosted: Fri May 22, 2009 11:53 pm
Reply with quote

Try convert dates in integer and compre them. Use DATE-OF-INTEGER and INTEGER-OF-DATE functions.

Basic date format in INTEGER-OF-DATE is CCYYMMDD.


Happy coding !!!
Cheers icon_smile.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat May 23, 2009 12:15 am
Reply with quote

Hello,

I must be missing something. . . icon_confused.gif

Quote:
If input-date GTEQ lower-given-date
and input-date LTEQ higher-given-date
then
the input-date falls between the two given dates.
How difficult is it to use the example posted by dbz and compare if a value is between 2006-10-01 and 2008-05-23?

Why would anything else be needed?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts SCOPE PENDING option -check data DB2 2
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top