|
I wonder too if just removing the DatFmt keyword would make everything work?
Scott Klement wrote:
There are two working test snippets of code below. On my v5r2 box, TEST1works, and TEST2 doesn't. TEST2 issues RNQ0114 "The year portion of a Date or Timestamp value is not in the correct range (C G D F)" for the statementdoing the %int(%char.This absolutely baffles me.. why this particular error? Maybe it doesn't understand the DATFMT(*USA) on an array? Have you tried leaving that off, and working with it as *ISO?FWIW, I never ever use DATFMT on a D-spec like you did, which might be why I never ran into this particular error. Whenever I work with dates, I always work with them in *ISO format, and then when it's time to print them or whatever I want to do with them, THAT's the point at which I specify the format.In your case, since you're specifying *YMD0 for the output, why would you care what format the input is?But, even so, your code SHOULD work... and in fact it does on my machine. (I'm at V5R3, but I specified TGTRLS(V5R2M0) when I compiled it.) and I see that others have tried it and didn't have problems on V5R2 either. Hmmm...
As an Amazon Associate we earn from qualifying purchases.
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.