×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Thanks,
Good to know. That's what I had thought, until my test showed that leading zeros were not required.
I will assume that dates will require the leading zeros just to be safe.
Paul
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of CRPence
Sent: Wednesday, May 30, 2012 12:11 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Date Validation
FWiW: That _functional_ effect [i.e. '5/7/2012' recognized as being a valid *USA formatted character date string] was described as an anomaly that should not be depended upon... by Barbara Morris:
http://archive.midrange.com/rpg400-l/201203/msg00323.html
The documentation referenced in my message [above link; quoting Barbara's] has not changed to suggest anything different in the equivalent documentation for v7r1:
IBM i 7.1 Information Center -> Programming -> Programming languages -> RPG -> ILE RPG Language Reference -> Definitions -> Chapter 9. Data Types and Data Formats
http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/topic/rzasd/sc092508283.htm#ddate
"
_i Date Data Type i_
Date fields have a predetermined size and format. They can be defined on the definition specification. Leading and trailing zeros are required for all date data.
...
"
Regards, Chuck
On 30 May 2012 09:45, Scott Mildenberger wrote:
Paul, Your right that it works fine when you have Date_in defined as
10A but the original post had it defined as varying 256A and that does
not work - I even tried %trim on Date_in. So, I get the error with the
following definition
D Date_in S 256A Varying inz('5/7/2012')
Beyond me to explain!
Paul Therrien on Wednesday, May 30, 2012 10:21 AM wrote:
I tried this code and it worked for me with V7R1.
Input parm of '5/7/2012' or '5/07/2012' or '05/07/2012'
CALL PGM(TESTRPG) PARM('5/7/2012')
CALL PGM(TESTRPG) PARM('05/7/2012')
CALL PGM(TESTRPG) PARM('5/07/2012')
dtestrpg PR extpgm('TESTRPG')
D Date_in 10A
dtestrpg PI
D Date_in 10A
D Date_Out S 8 0
D Date_Outc S 25a
Date_out = %uns(%char(%date(Date_in:*usa):*iso0));
Date_outc = %char(%date(Date_in:*usa):*iso0);
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.