× 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.



Hi,

I assume your date is stored in a 8A field and can contain '7/8/2007' or
'1/31/2007' or '12/3/2007' or '12/31/2007'.
Are you sure that date cannot handle these dates?
(Sorry I cannot try it out, because I have currently no access to an
iSeries)
/Free
Monitor;
MyDate = %Date(MyCharDate: *USA);
On-Error;
//Invalid Date
EndMon;
/End-Free

If RPG cannot handle this date, just try embedded SQL.
SQL recognizes characters strings as dates in one of the followin formats:
YYYY-MM-DD, YYYY-M-DD, YYYY-MM-D, YYYY-M-D
MM/DD/YYYY, M/DD/YYYY, MM/D/YYYY, M/D/YYYY
DD.MM.YYYY, MM.D.YYYY, D.MM.YYYY, D.M.YYYY

C/EXEC SQL
C+ Set :MyDate = Date(:MyCharDate)
C/End-Exec



Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"

-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im
Auftrag von Kelley
Gesendet: Tuesday, August 07, 2007 23:59
An: RPG400-L@xxxxxxxxxxxx
Betreff: Dates


I have a vendor that wants to send me a file to be uploaded to our iSeries.
The problem is with the dates that get sent. Normally, today's date would be

08/07/2007 which the %date biff would handle just fine. Unfortunately, the
dates I'm receiving drop the leading 0 in both the month and day, resulting
in 8/7/2007 which the %date doesn't like. Any ideas how to handle this other

then parsing it out?

Kelley



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.