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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How to check a date is falling in between two given dates
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: 6968
Location: porcelain throne

PostPosted: Wed May 20, 2009 7:10 pm    Post subject:
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Sat May 23, 2009 12:15 am    Post subject:
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    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 How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm


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