On Tue, 16 May 2017 18:55:25 -0500, Paul Gilmartin <[email protected]> wrote:

>On Tue, 16 May 2017 18:36:38 -0500, Mike Schwab wrote:
>
>>Maybe IBM can publish the info or an II apar to document the
>>application coding techniques causing the problem.
>>
>If move-with-truncation is a conventional COBOL operation,
>the resolution should not be, "Don't do that!"
>
>I detest quiet truncation.  It's hardly better if it takes an
>inordinately long time.
>
>Another possible resolution, with its own performance consequence,
>is for the compiler-generated code to test (every time) whether
>overflow is about to occur and handle it as a special case.  It
>might be better just to abandon the use of DFP.
>
>-- gil

There is a COBOL Compiler option, DIAGTRUNC, that will do the following:
DIAGTRUNC will issue a Warning message for MOVE statements to numeric fields 
when the receiving field has fewer integer positions than the sending field or 
literal.  In statements that have multiple receiving fields, the message is 
issued separately for each field that could be truncated. The message is also 
issued for moves to numeric fields from alphanumeric fields or literals, except 
when the sending field is reference modified.  Will find cases of ‘hidden’ loss 
of data when statements truncate numeric data items.

This is Compile time only, no affect on program execution.

-- 
Dale R. Smith

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to