On 04/07/2008, at 8:17 PM, IWilson@xxxxxxxxxxxxxxxxxx wrote:

I have the following defined in a PRGILE program.

D TestDate S D DatFmt(*iso) INZ(D'2008-07-04')

However what I want to do is assign a value to TestDate at runtime.

ie Something like

Eval TestDate = '2008-07-04'


Can't find anything about how to do this and when I try it
I get a compile time message that the left and right type are not the
same.

TestDate is a date (D) data type but '2008-07-04' is a character (A) data type so ...

First point: The compiler is rarely wrong ... so ...

Second point: You need to tell the compiler to interpret the character data as a date.

There are a number of ways to do that but since you are using a literal constant refer back to how you instructed the compiler to initialise the data field correctly.

Third point: You already know how to do this.

Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists

http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------




As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.