IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

PL/1 - Negative Zero


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
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

PostPosted: Fri Sep 14, 2012 2:14 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Sep 14, 2012 3:01 pm
Reply with quote

Quote:
Do you have any migration rule book?

we do not... IBM does icon_cool.gif

why not start from

www-03.ibm.com/systems/z/os/zos/bkserv/zappls2.html

proceed to the appropriate PL/I bookshelf

for example

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/Shelves/IBMSH370

and then to

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IBM3MG70/CCONTENTS?SHELF=IBMSH370&DN=GC27-1458-07&DT=20081017091529

there are also the bookshelves for the previous version of the compiler.

what kind of dumb organization do You belong that did not care to plan
by reading read the appropriate documentation before starting the conversion ???
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Fri Sep 14, 2012 3:09 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Negative dependency between jobs in m... COBOL Programming 12
No new posts Negative value - packed field - Natur... Java & MQSeries 0
This topic is locked: you cannot edit posts or make replies. Missing Negative sign in COBOL COBOL Programming 6
No new posts CA7 Negative dependency JOB=/ CA Products 0
No new posts Subtract the ZD fields to provide neg... DFSORT/ICETOOL 4
Search our Forums:

Back to Top