If you want to validate a date in RPG/400, you write your own routine to do it. You parse the value and decide if each segment is valid according to the format that your program expects.
There is no special handling of dates in RPG/400. The coding is completely up to you.
Alternatively, you can go outside of RPG and call the <a href="http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/apis/qwccvtdt.htm">Convert Date and Time Format (QWCCVTDT) API</a> to attempt a conversion of a temporary variable. If you don't receive an error, then the date is valid.
Overall, it's easier to use RPG IV.
Last Wiki Answer Submitted: August 11, 2010 7:51 am by TomLiotta108,055 pts.
All Answer Wiki Contributors: TomLiotta108,055 pts.