Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

conversion

Former Member
0 Likes
546

Hi,

i have calculations in my program with packed decimals

x / y both x and y are packed decimals.

unfortunately y got some value 0.00 and throughing dump while executing the program.

is it appropriate to write <b>if y eq '0.00'

replace '0.00' with '1.00'

endif.

x/y</b>

1 ACCEPTED SOLUTION
Read only

ferry_lianto
Active Contributor
0 Likes
527

Hi,

Yes, you can.

Also you can code like this.

IF Y IS INITIAL.

Y = 1.

ELSE.

...

ENDIF.

Regards,

Ferry Lianto

4 REPLIES 4
Read only

Former Member
0 Likes
527

why dont you just use

if y eq 0.

y = 1.

endif.

This code should work

Read only

Former Member
0 Likes
527

it depends on ur logic and validations.

If u want an error message u can give error message or else if u want the value then u can use the logic mentioned.\if y eq '0.00'

replace '0.00' with '1.00'

endif.

x/y

Read only

ferry_lianto
Active Contributor
0 Likes
528

Hi,

Yes, you can.

Also you can code like this.

IF Y IS INITIAL.

Y = 1.

ELSE.

...

ENDIF.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
527
if y ne 0.

   z = x/y.

endif.