Hi, all. In the course of accommodating older *CYMD date formats, I'm playing around with %DATE, %CHAR, and TEST(DE). I step through the following code in debug:
When I enter "03/31/2012" into DSP_P1InDate, it apparently passes TEST(DE); control passes to the "NOT %ERROR" path. But the EVAL fails with RNX0112 ("Date, Time or Timestamp value is not valid.").
Having passed the TEST(DE) test, I expected the %DATE BIF to successfully convert the characters to a date. Am I not correctly understanding how either TEST(DE) or %DATE works? Why does/might this fail?
Code:
// DCL-S DateEntered DATE; // DSP_P1InDate is character 10A, from a DSPF. TEST(DE) *MDY DSP_P1InDate; IF NOT %ERROR; ErrPosition = 'A'; DateEntered = %DATE(DSP_P1InDate : *MDY);
Having passed the TEST(DE) test, I expected the %DATE BIF to successfully convert the characters to a date. Am I not correctly understanding how either TEST(DE) or %DATE works? Why does/might this fail?
Comment