I just want to check a date (format ddmmyy) in ILE RPG but I don't know
what's wrong with these lines...
D DateIn S D datfmt(*dmy)
C test (e) DateIn
C if %error
C exsr $errormsg
C endif
The input date is for example 241000 and I always get an error. Can
anybody help me, because I'm very new in programming with ILE-RPG.
Thanks
Bernd
You need to input the value to either a numeric or character field.
Then test the value to see if its a valid date. If its valid you may
then move it to a date type field.
On Thu, 29 Nov 2001 11:40:10 +0100, Oesi <bernd.oe...@uni.de>
wrote:
Your source editor will tell you which position to place the indicator in.
Good luck,
Brooks
Think of a date field as a character field which you are allowed to do
date type functions such as adding a duration, calculating a duration,
and comparing dates as dates regardless of the date fields format. In
other words, you can compare a DD/MM/YY date field with a MM/DD/YY
date field and get the results you would expect.
Now, the beauty of the TEST op-code is that you can use it to test a
numeric field to check if it contains a valid date. However, when you
are testing a numeric field for a valid date value you have to tell
the system (in factor 1) what format the numeric field represents.
When testing a truely defined date field you don't have to tell the
system the format because it already knows what format the date should
be in.
David Scorca
Computer Solutions, Inc.
305 558-7000 x131
On Thu, 29 Nov 2001 11:40:10 +0100, Oesi <bernd.oe...@uni.de>
wrote:
>Hi everybody,
Are you testing to see if the field contains a date at all? Then compare it to the low value in that date format:
C If Date > D'01/01/01'
C .........(valid)
C Else
C ..........(invalid)
C Endif
If the date in question is a null capable field, test for %NULLIND(date) being *ON or *OFF. If it's *ON, there is no date in there.
--
Regards,
Francis Lapeyre
"Facilius est camelum per foramen acus transire quam divitem intrare in regnum Dei."
(Mk 10:25)
Return address is filtered via SpamCop.
"Oesi" <bernd.oe...@uni.de> wrote in message news:3C06108A...@uni.de...
"Oesi" <bernd.oe...@uni.de> a écrit dans le message news:
3C06108A...@uni.de...
> I just want to check a date (format ddmmyy) in ILE RPG but I don't know
> what's wrong with these lines...
[cut]
> Can anybody help me, because I'm very new in programming with ILE-RPG.
Try to read this:
"RPG IV Date Support"
http://www.rpgiv.com/seminars/datetime.pdf
> Thanks
> Bernd
I hope it may help you to bettr understand the way date data type are used...
Stefano
"Niuna impresa, per minima che sia
può avere cominciamento e fine senza queste tre cose:
e cioè senza sapere, senza potere, senza con amore volere"
[Anonimo fiorentino, XIV sec.]