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

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.

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

Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
ASCII Ribbon campaign against HTML E-Mail / \

This thread ...


Return to Archive home page | Return to MIDRANGE.COM home page