On 1 May 2009 06:41:19 -0700, in bit.listserv.ibm-main you wrote:

>> -----Original Message-----
>> From: IBM Mainframe Discussion List On Behalf Of Farley, Peter x23353
>> 
>> > -----Original Message-----
>> > From: IBM Mainframe Discussion List On Behalf Of Clark Morris
>> <Snipped>
>> > On 30 Apr 2009 13:00:02 -0700, in bit.listserv.ibm-main you wrote:
>> >
>> > 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.
>> 
>> Son of a gun, that did it.  From half a page of code to six
>> instructions.
>> 
>> I will have to test this program with TRUNC(OPT) pretty carefully to
>> make sure it has no other adverse affects.  The doc on OPT is pretty
>> clear in its warnings.
>> 
>> And the doc on TRUNC(BIN) does have the phrase "... you can avoid the
>> performance overhead of using TRUNC(BIN) ...", implying there is, in
>> fact, a performance penalty for using it.
>> 
>> Thanks for pointing out the benefit of TRUNC(OPT) to me.
>
>But then there's this in the "Notes" for TRUNC in the Installation &
>Customization Guide:
>
>" 2. TRUNC=BIN is the recommended option when interfacing with other
>products that have S/390-format binary data (such as CICS, DB2, FORTRAN,
>and PL/I). This is especially true if there is a possibility of having
>more than 9 digits in a fullword or more than 4 digits in a halfword."
>
>So, we're stuck with TRUNC(BIN) in CICS, where arguably we'd want the
>"best" performance.  :-(

The manual in a sense lies.  With TRUNC(OPT), if all operands are
binary in any given operation, NO truncation to picture occurs.  If
there is any conversion such as move binary field to a character
field, then the picture is honored.  To get around this first move a
S9(9) binary field to a S9(10) binary field and then move that field
to a character or packed decimal field.  Using the DISPLAY verb means
there is an implicit conversion and the PICTURE is honored.  This
whole mess could be avoided if IBM would just implement the USAGES in
the 2002 COBOL standard.  
>
>    -jc-
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to