View previous topic :: View next topic
|
Author |
Message |
anil_k_batra@yahoo.com Currently Banned New User
Joined: 14 Dec 2005 Posts: 2 Location: Gurgoan
|
|
|
|
We are facing problem when migrating to Enterprise PL/1. Do you have any migration rule book?
DCL IN_FLD PIC’(6)9’;
DCL IN_SIGN CHAR(1);
DCL OUT_FLD FIXED DEC(7);
OUT_FLD = IN_FLD;
IF IN_SIGN = ‘-‘ THEN
DO;
OUT_FLD = OUT_FLD*(-1);
END;
In Case IN_FLD is 0 ( Zero) with IN_SIGN = ‘-‘, the OUT_FLD is having result as 0 (Zero) with Enterprise Compiler. With Old Compiler, Results are -0 or X(0C) . We have changed the compiler options to “FORCEDSIGN” but results are without Negative Sign. This is working fine for other Numeric Values.
Please provide your thoughts. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
anil_k_batra@yahoo.com wrote: |
We are facing problem when migrating to Enterprise PL/1. Do you have any migration rule book?
DCL IN_FLD PIC’(6)9’;
DCL IN_SIGN CHAR(1);
DCL OUT_FLD FIXED DEC(7);
OUT_FLD = IN_FLD;
IF IN_SIGN = ‘-‘ THEN
DO;
OUT_FLD = OUT_FLD*(-1);
END;
In Case IN_FLD is 0 ( Zero) with IN_SIGN = ‘-‘, the OUT_FLD is having result as 0 (Zero) with Enterprise Compiler. With Old Compiler, Results are -0 or X(0C) . We have changed the compiler options to “FORCEDSIGN” but results are without Negative Sign. This is working fine for other Numeric Values.
Please provide your thoughts. |
My thought is that you and team are lacking in knowledge of both mathematics and programming. X'0C' is not a (packed-decimal) negative zero; X'C' is a positive sign, not a negative sign. As 0*n = 0 for all n, any result other than the one that you are getting would indicate a seriously broken compiler. There are differences in slack-bit results between Enterprise and MVS PL/I, but that is not the case here. |
|
Back to top |
|
|
|