How to test char date in format yyyy/mm/dd ?
I try to use :
*YMD TEST(D) DATE 80
I want to test this 2021/15/30 date because I want to make sure the date is validated but seems like it doesn't work even if I test the right Date like 2021/06/01. What should I do?
I also try this :
Eval DT = %CHAR(%DATE(DATE:*YMD/))
*YMD TEST(DE) DT
IF NOT %ERROR()
Move DT DATE
Write Currec
Endif
I enter 2021/06/01 as input but got this error instead :
What should I do?
RPG doesn't support the YYYY/MM/DD format. You can use %XLATE to change the / to - and then use the *ISO format.
EVAL DATE = %XLATE('/' : '-' : DATE)
*ISO TEST(DE) DATE