Start of change

VALIDATE(*NODATETIME)

The VALIDATE keyword specifies whether Date, Time and Timestamp data must be validated before it is used.

If this keyword is not specified, then Date, Time and Timestamp data is validated before it is used.

If *NODATETIME is specified, the compiler may omit performing validation for Date, Time and Timestamp data before it is used.

Specifying this keyword may improve the performance of the RPG program. In some cases, the compiler may be able to treat the Date, Time, or Timestamp data as though it was Alphanumeric data, avoiding the costly operations that deal with true Date, Time and Timestamp data.

Some examples of validations that will be omitted with VALIDATE(*NODATETIME):
CAUTION:

When validation is not done, incorrect data will not be detected.

Use this keyword only if you are confident that the data in all your date, time, and timestamp fields is always valid. For example, if you have a data structure that has the default initialization of blanks, the date, time, and timestamp subfields will be initialized with the invalid value of blanks. If you specify VALIDATE(*NODATETIME), and use any of these subfields, the invalid data will be used in the operation, and it may be propagated to other fields in your program through assignments, or you may get meaningless results for comparison operations.

This warning applies even for Date, Time and Timestamp operations that do not appear in the list of the validations that will be omitted. In the future, additional validations may be omitted when VALIDATE(*NODATETIME) is specified.

Recommendations:
End of change