On 30 Apr 2009 13:00:02 -0700, in bit.listserv.ibm-main you wrote: >> -----Original Message----- >> From: IBM Mainframe Discussion List [mailto:[email protected]] On >> Behalf Of Steve Comstock >> Sent: Thursday, April 30, 2009 3:30 PM >> To: [email protected] >> Subject: Re: Enterprise COBOL code generation question ><Snipped> >> Peter, >> >> I can't speak with authority, since the details are hidden and, >> to some degree, proprietary. But I once learned that when working >> with pic s9(9) binary data, the compiler converts to packed to >> avoid or intercept overflows. The simplest fix / workaround is to >> declare these fields as s9(8) binary. Give that a try and see if >> it works better. > >Tried that, and got the same results. Also tried using "constant" >variables defined the same way as the variable to be tested (both S9(9) >and S9(8) versions) and that is even worse -- BOTH the variable AND the >"constant" variables are converted to packed and then compared with CP. > >Another lister wrote me offline to say that Enterprise COBOL may be >"following the standard" in this bizarreness, but when I have TRUNC(BIN) >in effect, doesn't that tell the compiler I want something *different* >from the "standard"?
Try TRUNC(OPT). Trunc STD would require the conversion to decimal to guarantee that the data fit the picture. TRUNC(BIN) is known and documented to generate less than optimal code. > >Bah, humbug. Lazy compiler writers ought to be taken out and ... well, >you get the idea. > >Peter > > >This message and any attachments are intended only for the use of the >addressee and >may contain information that is privileged and confidential. If the reader of >the >message is not the intended recipient or an authorized representative of the >intended recipient, you are hereby notified that any dissemination of this >communication is strictly prohibited. If you have received this communication >in >error, please notify us immediately by e-mail and delete the message and any >attachments from your system. > > >---------------------------------------------------------------------- >For IBM-MAIN subscribe / signoff / archive access instructions, >send email to [email protected] with the message: GET IBM-MAIN INFO >Search the archives at http://bama.ua.edu/archives/ibm-main.html ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

