I tried to evaluate the timestamp value 2023-02-01-12.09.24.125874
to a timestamp, a variable declared in the RPGLE program and got severity 30
compile error *RNF7416
message-id with error message text in the compile listing as The types of the right and left hand side do not match in the EVAL operation
Dtimestamp1 s Z
/free
timestamp1 = '2024-03-16-15.10.40.456465';
return;
/end-free
Line 1: Declared a timestamp-type standalone variable timestamp1
.
Line 2 & 5: /Free
and /End-Free
block for writing RPG-free code within this script.
Line 3: Evaluate timestamp value 2024-03-16-15.10.40.456465
to timestamp1
variable of type timestamp.
Line 4: return from the RPG program.
In this case, you are trying to evaluate a timestamp value in character format into a timestamp variable at line 3
timestamp1 = '2024-03-16-15.10.40.456465';
in your RPG program which is incorrect and you, therefore, are getting the errorseverity 30 error *RNF7416
during the compilation of your RPG program in the program compile listing.Try to convert the character value to timestamp value using
%timestamp
built-in functiontimestamp1 = %timestamp('2024-03-16-15.10.40.456465');
and then evaluate to a timestamp variable.The following code will resolve the issue
*RNF7416
error during program compilation.