Skip to Main Content
IBM Z Software


This portal is to open public enhancement requests against IBM Z Software products. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).


Shape the future of IBM!

We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:

Search existing ideas

Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,

Post your ideas
  1. Post an idea.

  2. Get feedback from the IBM team and other customers to refine your idea.

  3. Follow the idea through the IBM Ideas process.


Specific links you will want to bookmark for future use

Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.

IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.

ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.

Status Not under consideration
Workspace COBOL Compilers
Created by Guest
Created on Jun 18, 2015

COBOL5: extended DIAGTRUNC feature for detecting variables size mismatch

COBOL 5 behaves differently than in previous versions, in some scanarios, as in the following case:

- Programs that move data to and from data items that at run time contain values not conforming to the PICTURE clause in the data description entry. (ftp://publibfp.boulder.ibm.com/epubs/pdf/igy5mg20.pdf, page 181: Error behavior changes for incorrect programs)

We have detected different behaviour in some COBOL programs after recompilation with COBOL 5. It occurs when a program compares variables with a size mismatch and one of them exceeds its size. Comparing PIC S9(5) and PIC S9(6), in previous versions worked fine also with values above 100000, but as COBOL 5 is more restrictive, when loop reach that value program logic changes (its more sensitive with size variables definition, but DISPLAY behave as in previous COBOL versions, they show all figures).
Compilation with COBOL 5 ends without any warnings, as in previous COBOL versions, but its logic change.

We would like a compiler option similar to TRUNCDIAG (which detects MOVE items size mismatch, issuing a Warning) to detect potential risks in other operations as IF, ADD...

Idea priority High
  • Guest
    Reply
    |
    Jul 14, 2020

    Hi, since we have not heard back from you on the NUMCHECK testing, we shall go ahead and close this RFE. Feel free to open a new one once the required information is collected. Thanks.

  • Guest
    Reply
    |
    Jul 7, 2020

    Hi, may I know if you got a chance to test NUMCHECK for this RFE? Since we have not heard back from you, we shall keep this RFE open till Tuesday, July 14th, 2020; after which we shall go ahead and close it. Thanks.

  • Guest
    Reply
    |
    Jun 23, 2020

    Hi, may I know if you got a chance to test NUMCHECK for this RFE? Thanks.

  • Guest
    Reply
    |
    Jun 4, 2020

    While reviewing our RFE backlog, we believe NUMCHECK should be used for these scenarios.

    Please test with NUMCHECK and let us know your thoughts.

    Thanks.

  • Guest
    Reply
    |
    Mar 28, 2016

    Well, I'm not sure about this.

    For Case 1, the only way that W-NUMMOV-VALIDO-D can validly contain more the 99999 is with compiler option TRUNC(BIN). Since it was "working" in V4 and not in V5 (and assuming the same TRUNC sub-option is being used in V4 and V5), then it is being done in an invalid way, with compiler option TRUNC(OPT).

    So, with TRUNC(BIN), there is no issue as the truncation is to field-size. With TRUNC(STD) there is no issue as the truncation is strictly to PICture. With TRUNC(OPT) the programmer has entered into a contract to not use values which do not conform to PICture.

    Looks like bad code which "happened" to work for that particular code sequence in V4, but very little chance that V5 would produce the same "whatever's best at the time" optimisation as V4.

    In the second case, the definition of the second item in the comparison is not shown. Without that, isn't it difficult to know what is being asked?

    Comparing fields of different sizes is done all the time. I think a compiler option to flag them would/could produce so many messages, in and across programs, that all such messages would often be routinely ignored. Truncation is an intrinsic part of COBOL.

  • Guest
    Reply
    |
    Sep 14, 2015

    Due to processing by IBM, this request was reassigned to have the following updated attributes:
    Brand - Servers and Systems Software
    Product family - Programming Languages
    Product - COBOL Compilers

    For recording keeping, the previous attributes were:
    Brand - Rational
    Product family - Design & development
    Product - COBOL Compilers

  • Guest
    Reply
    |
    Aug 25, 2015

    Valid feature request. Accepting RFE. The RFE will be updated once it has been put into plan.

  • Guest
    Reply
    |
    Aug 12, 2015

    N/A

  • Guest
    Reply
    |
    Aug 4, 2015

    Thanks, we are currently evaluating your response.

  • Guest
    Reply
    |
    Jul 29, 2015

    Hi,

    I attach our answers:

    1) We would like to detect both (any) mismatches

    2) We are looking for any change at COBOL 5 behavior, including truncations, but even more important for us are behavior changes at program logic due to COBOL 5 improved sensibility in certain cases as variables mismatch.
    We would like to detect these potential issues in advance, at compilation time, via a warning or error, allowing us to detect and fix them.

    3) I attach two examples:

    CASE1:

    Variables definition:
    05 W-NUMMOVIM-ANT PIC S9(06)V COMP-3.
    05 W-NUMMOV-VALIDO-D PIC S9(5) COMP VALUE 1 .

    Source code:
    IF W-NUMMOVIM-ANT NOT = W-NUMMOV-VALIDO-D
    MOVE '009' TO BMYDS100-CODINC
    PERFORM 2400-INCIDENCIA
    THRU 2400-INCIDENCIA-F
    END-IF

    Explanation
    In previous COBOL versions both variables were considered equal even when value 100.000 was reached. With COBOL 5 comparison behavior has changed and above that value, consider values of both variable different.

    CASE2:

    Variables definition:
    10 MON-CODISOMO PIC X(3).
    10 WK-CODISOMO PIC 9(03).

    Source code:
    SEARCH ALL ELEMENTO-MONEDA
    AT END
    PERFORM 22221-ERROR-MONEDA-ORIGEN
    WHEN WK-CODISOMO(WK-INDMON-TABLA) = M4Y21003-MONORIG

    Explanation:
    In previous COBOL versions a value was found in the table using a variable defined different than DB2 field (alpha numeric vs numeric), with COBOL 5 it isn't found.

    Both CASES:
    In both examples COBOL 5 different behavior was found after its execution, and programming changes were required to fix it. We would like to discover these issues at compilation time to avoid problems in our shop.

    4) We are interested in detecting at compilation time any change of program logic that could impact our shop, changing current execution path of our applications due to new behavior (sensibility) with COBOL 5 compared with previous COBOL versions (4.2 and earlier ones).

    Please do not hesitate to contact us if you require further information

    Regards


    Pablo Alonso

  • Guest
    Reply
    |
    Jul 29, 2015

    a

  • Guest
    Reply
    |
    Jul 15, 2015

    Hi, we have a few questions that we would need to know before making a decision on this RFE:
    1) may we know if you want to detect numeric or alpha numeric type mismatches? If so, exactly what kind?
    2) Or are you looking to find where truncations can occur?
    3) Also, what is the exact source that causes problem with V5.x?
    4) Are you interested in finding statements that are different between V5.x and V4.x?

    Thanks

  • Guest
    Reply
    |
    Jun 18, 2015

    Due to processing by IBM, this request was reassigned to have the following updated attributes:
    Brand - Rational
    Product family - Design & development
    Product - COBOL Compilers
    Component - Miscellaneous
    Operating system - IBM z/OS
    Source - None

    For recording keeping, the previous attributes were:
    Brand - Servers and Systems Software
    Product family - zBLC family
    Product - zBLC
    Component - zBLC Requirements
    Operating system - IBM z/OS
    Source - None