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
 

 

Date comparison in Natural

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries
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    Post subject: Date comparison in Natural
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Jun 10, 2009 10:37 pm    Post subject: Reply to: Date comparison in Natural
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: 2360
Location: Israel

PostPosted: Sun Jun 21, 2009 5:17 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> Java & MQSeries All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 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
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm


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