I try to validate the date field but the Indicator sets on for both valid and invalid. Please advice.
D datevalid S 8A inz('20131225')
D dateINVAlid S 8A inz('99999999')
*
/free
test(DE) *ymd0 datevalid;
if %error() ;
dsply 'Error!' ;
endif ;
/end-free
*
C *YMD TEST(D) datevalid 44
C N44'valid' dsply
C *YMD TEST(D) dateINVAlid 55
C 55'INVALID' dsply
In the other thread, this question here was added as the "Answer". I cut it out and used 'Discuss' to respond. It seemed to be a reasonable continuation of the original question. The OP here probably needs some experience in tracking these threads. -- Tom
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!
Discuss This Question: 6  Replies
You need to use a valid date if you want the test to succeed. "20131225" is not valid for format *YMD.
Tom
Odd, I thought that there was another response to this question.
It said use *ISO for the format.
Yes, thanks .. and as you said on that version the format should be *ISO0