I use the "*LOVAL" instead of the literal value to determine if a date field contains a date like so:
// Insurance Plan Effective Dates
If DateField <> *Loval ;
....
....
EndIf ;
Doing this prevents the program from generating an error when you try to use an empty date field.
Hope this helps,
Adrian Mercado
N2N Global, Inc.
-----Original Message-----
From: WDSCI-L [mailto:wdsci-l-bounces@xxxxxxxxxxxx] On Behalf Of wdsci-l-request@xxxxxxxxxxxx
Sent: Wednesday, June 10, 2015 1:00 PM
To: wdsci-l@xxxxxxxxxxxx
Subject: WDSCI-L Digest, Vol 13, Issue 261
Send WDSCI-L mailing list submissions to
wdsci-l@xxxxxxxxxxxx
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.midrange.com/mailman/listinfo/wdsci-l
or, via email, send a message with subject or body 'help' to
wdsci-l-request@xxxxxxxxxxxx
You can reach the person managing the list at
wdsci-l-owner@xxxxxxxxxxxx
When replying, please edit your Subject line so it is more specific than "Re: Contents of WDSCI-L digest..."
*** NOTE: When replying to this digest message, PLEASE remove all text unrelated to your reply and change the subject line so it is meaningful.
Today's Topics:
1. Date literal not valid (Mark Murphy/STAR BASE Consulting Inc.)
2. Re: Date literal not valid (Kurt Anderson)
----------------------------------------------------------------------
message: 1
date: Wed, 10 Jun 2015 10:00:40 -0400
from: "Mark Murphy/STAR BASE Consulting Inc."
<mmurphy@xxxxxxxxxxxxxxx>
subject: [WDSCI-L] Date literal not valid
I am getting a validation error within RDi 9.1.1. The following code gives RNF0305E, RNF0604E, and RNF0637E:
if field = d'0001-01-01';
...
endif;
This code compiles fine as I have defined ctl-opt DatFmt(*ISO); but it appears that RDi does not recognize that. In fact if I change it to:
if field = d'0001/01/01';
...
endif;
The RDi errors go away, but the compile fails.
Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx
------------------------------
message: 2
date: Wed, 10 Jun 2015 15:47:27 +0000
from: Kurt Anderson <Kurt.Anderson@xxxxxxxxxxxx>
subject: Re: [WDSCI-L] Date literal not valid
RDi shouldn't care if your "field" field is *usa, *iso, etc.
You can compare a *iso date field to a *ymd date field. They're both date fields and RPG does the conversion.
I just did this and RDi didn't care:
dcl-s field date( *ymd );
if field = d'0001-01-01';
EndIf;
Can you reproduce the issue in a small piece of code that you can share?
I'm at RDi 9.1.1.1 (one more .1 than you mentioned) so that could be a difference.
Kurt Anderson
Sr. Programmer/Analyst - Application Development, Service Delivery Platform
-----Original Message-----
From: WDSCI-L [mailto:wdsci-l-bounces@xxxxxxxxxxxx] On Behalf Of Mark Murphy/STAR BASE Consulting Inc.
Sent: Wednesday, June 10, 2015 10:01 AM
To: Rational Developer for IBM i / Websphere Development Studio Client for System i & iSeries
Subject: [WDSCI-L] Date literal not valid
I am getting a validation error within RDi 9.1.1. The following code gives RNF0305E, RNF0604E, and RNF0637E:
if field = d'0001-01-01';
...
endif;
This code compiles fine as I have defined ctl-opt DatFmt(*ISO); but it appears that RDi does not recognize that. In fact if I change it to:
if field = d'0001/01/01';
...
endif;
The RDi errors go away, but the compile fails.
Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx
--
This is the Rational Developer for IBM i / Websphere Development Studio Client for System i & iSeries (WDSCI-L) mailing list To post a message email: WDSCI-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/wdsci-l
or email: WDSCI-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/wdsci-l.
------------------------------
Subject: Digest Footer
--
This is the Rational Developer for IBM i / Websphere Development Studio Client for System i & iSeries (WDSCI-L) digest list To post a message email: WDSCI-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/wdsci-l
or email: WDSCI-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/wdsci-l.
------------------------------
End of WDSCI-L Digest, Vol 13, Issue 261
****************************************
As an Amazon Associate we earn from qualifying purchases.