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



I think we've all missed the boat here. The OP has a date where the month
is three characters--i.e., JAN, FEB, MAR, APR,.... I don't believe %date
is going to work for him.

The CEEDAYS API (documentation at:
www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_71/apis/CEEDAYS.htm) will
convert it to a Lilian date. A Lilian format date is the number of days
since the 14th of October 1582. From there, he'll have to convert it to
whatever it was that he wanted for the final format--I believe a real date
field. That'll require another CEE API (I don't remember which off the top
of my head) and then he can use the %date bif.

I've used these APIs before, but it's been a while. I wrapped them all up
into a service program to handle anything I've ever needed to do with
dates. If I have time later (ha!), I'll post sample code.

"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx> wrote on 01/08/2015 08:13:23
AM:

To:

"RPG programming on the IBM i (AS/400 and iSeries)"
<rpg400-l@xxxxxxxxxxxx>

Subject:

Re: Converting a date

I am lost here. If we have a numeric value, why are we converting it to
an
alpha value?

d NumDate...
d s 8p 0 Inz(20140101)
d DateField...
d s d
d NumDateUSA...
d s 8p 0
d NumDateAlpha...
d s 10a Inz('01/01/2014')
DateField = %Date(NumDate:*ISO); // or whatever format you need.

// convert to *USA format.

NumDateUSA = %Dec(%Date(NumDate:*ISO):*USA);

NumDateUSA should be 01012014.

DateField = %Date(NumDateAlpha:*USA/);

etc.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.