I saw that Luis. But 10/1/2012 converts correctly when it is in a
character field. But not when in a varying field. I do not know if that is
a feature or a bug.
thanks,
Steve
On Tue, Jan 29, 2013 at 11:35 AM, Luis Rodriguez <luisro58@xxxxxxxxx> wrote:
Steve,
I think your date should be '10/01/2012' (please note the leading zero for
the month).
Regards,
Luis Rodriguez
IBM Certified Systems Expert — eServer i5 iSeries
--
On Tue, Jan 29, 2013 at 11:56 AM, Steve Richter <stephenrichter@xxxxxxxxx
wrote:
can someone confirm that this code bombs on their system? The following
code converts from character to date. Each of the %date functions work
for
me except the last one. Converting from varying to date when the date
format is *USA.
** --------------------- ConvertTester --------------------------
** test conversion of string to date.
pConvertTester b
dConvertTester pi
d ch30 s 30a
d dt1 s d
d vary30 s 30a varying
/free
// convert character date in *iso format.
vary30 = '2012-10-01' ;
ch30 = vary30 ;
dt1 = %date(ch30:*iso) ;
dt1 = %date(vary30:*iso) ;
// convert character date in *usa format.
vary30 = '10/1/2012' ;
ch30 = vary30 ;
dt1 = %date(ch30:*usa) ;
// this bombs.
dt1 = %date(vary30:*usa) ;
/end-free
p e
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.