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

Date comparison in Natural


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
RockyS

New User


Joined: 16 Apr 2009
Posts: 10
Location: India

PostPosted: Wed Jun 10, 2009 9:43 pm
Reply with quote

How do we compare dates in Natural? Suppose I want to select a policy whose inception date is less than 12 Jun 2009. How should my query look like?
I know the below query will work in my case (as the date format in adabas file is YYYYMMDD) but wanted to know a standard way of comparing date.

Code:
F062-INCEP-DATE  <  20090612


Pardon me if it sounds silly but I am pretty novice to Naturals.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Jun 10, 2009 10:37 pm
Reply with quote

What's the proper syntax recommended in the Natural documentation, regarding this type of numeric compare?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Sun Jun 21, 2009 5:17 pm
Reply with quote

There is no "standard" method, as there are about 14 types of DATE in Natural.

O.
Back to top
View user's profile Send private message
Ralph Zbrog

New User


Joined: 21 Nov 2009
Posts: 58
Location: California

PostPosted: Fri Dec 11, 2009 1:05 pm
Reply with quote

As Ofer71 says, there is no standard, but a common practice is to convert your external date variable (eg A8: yyyymmdd) to a temporary D-format variable using a MOVE EDITED. The D-format makes comparisons and computations simple and straightforward.

For example, RockyS' comparison would look something like this:
Code:
IF  #F062-INCEP-DATE-D  <  D'2009-06-12'
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 -> Java & MQSeries

 


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 Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
No new posts Fetch data from programs execute (dat... DB2 3
Search our Forums:

Back to Top