Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

PL/1 - Negative Zero

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: PL/1 - Negative Zero
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Fri Sep 14, 2012 3:01 pm    Post subject: Reply to: PL/1 - Negative Zero
Reply with quote

Quote:
Do you have any migration rule book?

we do not... IBM does icon_cool.gif

why not start from

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

proceed to the appropriate PL/I bookshelf

for example

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

and then to

http://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: 1746
Location: Bloomington, IL

PostPosted: Fri Sep 14, 2012 3:09 pm    Post subject: Re: PL/1 - Negative Zero
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Negative value used in IFTHEN jacobdng DFSORT/ICETOOL 3 Tue Aug 04, 2015 2:12 pm
No new posts Does FUNCTION NUMVAL work for alphanu... Venkata Ramayya COBOL Programming 8 Fri Mar 20, 2015 10:43 pm
No new posts Conversion of negative amount (comp3)... dharmaraok COBOL Programming 9 Mon Feb 24, 2014 5:27 pm
No new posts Extract records from a file based on ... suraaj DFSORT/ICETOOL 6 Wed Jan 29, 2014 1:14 am
No new posts Data representation with negative values Raghu navaikulam COBOL Programming 4 Tue Jan 14, 2014 9:36 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us