How to fix EVAL statement in RPGLE PGM

230 pts.
Tags:
AS400 Data Definitions
AS400 iseries
AS400 RPGLE
I have two fields defined in RPGLE PGM. One is in O spec:
O BCENTH Z
and one is in D spec:
D DS 
D TCALC 10 0 
When I do an EVAL statement:
EVAL BCENTH = TCALC 
It gives me a compiler error:
 *RNF7416 30 1002 053200 The types of the right and left hand side do not match in the EVAL operation. and 
*RNF7059 20 1200 072800 Editing is not valid with field BCENTH that is not numeric. Editing is ignored. 
What changes i have to make in my PGM?


Software/Hardware used:
i-series

Answer Wiki

Thanks. We'll let you know when a new response is added.

Where is BCENTH defined.
If it is in the O spec as you are showing then you are defined it as a timestamp.
My guess is you what the Z to be the edit code so it will do a zero supress.
If that is the case you need to create a D spec to define DCENTH as a numeric field

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    O BCENTH Z It's impossible to tell what that is without formatting. Is it a timestamp? Or is it a zero-suppress edit code for a field in a printer file? Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    I don't remember O specs declaring variables, they just format the output. So since this field isn't declare the variable the compilier issues an error and assumes the type char,. which leads to the error you've identified. phil
    49,850 pointsBadges:
    report
  • TomLiotta
    I don’t remember O specs declaring variables, they just format the output. Although variables are not declared in O-specs, data type can be specified to describe the handling in output. Regardless, the combination of error messages means your description is probably correct. We'll see what code gets posted, though it might not be necessary. Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following