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 Future consideration
Workspace COBOL Compilers
Created by Guest
Created on Mar 1, 2021

Enterprise Cobol - Pseudo figurative constants "max-value" and "min-value"

In some processing, we need to assign the greatest possible value, or the smallest possible value, to a data-item, without necessarily knowing the PICTURE and the USAGE of this data-item (processing carried out by COPYBOOKs of general interest) .

The "high-value" or "low-value" figurative constants are not suitable for feeding numeric zones (or purely alphabetic zones), because this generates warnings or abends at runtime (in particular with the NUMCHECK option active).

We would like "pseudo" figurative constants ("pseudo" because adaptive to the context) to be supported by the compiler:
- "max-value" to assign to a data-item the greatest possible value and in accordance with PICTURE and USAGE,
- "min-value" to assign to a data-item the smallest possible value and in accordance with PICTURE and USAGE.

Examples:
- PIC S9(3): "max-value" = +999, "min-value" is -999
- PIC 9(3): "max-value" = 999, "min-value" is 000
- PIC S9(3) COMP-5: "max-value" is +32767, "min-value" is -32768
- PIC ZZ9: "max-value" is 999, "min-value" is 2 spaces fallowed by 1 0
- PIC A(3): "max-value" = ZZZ, "min-value" = spaces
- PIC X(3): "max-value" = x'FFFFFF ', "low-value" = x'000000'

These "pseudo" figurative constants must be able to be used in different contexts where they will adapt to the description of the related data-item:
- in move instructions: "move max-value to :data-item:" (including initialize ... replacing ... by max-value ")
- in comparison instructions? (no use case identified)
- in declarations: "05 :data-item: PIC :apic: value max-value."

Idea priority Low
  • Guest
    Reply
    |
    Jun 3, 2021

    We will be accepting this RFE for MAX-VALUE and MIN-VAULE, but not for dates. The RFE will be updated once put into plan.

  • Guest
    Reply
    |
    Apr 29, 2021

    Is it possible to change headline of this RFE from ==Pseudo figurative constants "max-value" and "min-value"== to ==Intrinsic Function "max-value" and "min-value"== ?

    I think Intrinsic Function would be more appropriate and will avoid a response like "rejected, not in COBOL standard"...

  • Guest
    Reply
    |
    Apr 18, 2021

    Could also be an intrinsic function:

    move function max-value (this-data-item) to this-data-item

    move function min-value (this-data-item) to this-data-item

    if incoming-data-item > function max-value (receiving-data-item) then
    display « overflow »
    else
    move incoming-data-item to receiving-data-item
    end-if


    Function « receive » data-item type and data-item length and can « return » the min or max value for this data-item.

  • Guest
    Reply
    |
    Apr 10, 2021

    Hi,

    Use case for condition against a min or max value :

    IF incoming-dataitem > max-value of receiveing-dataitem THEN
    DISPLAY "overflow"
    END-IF

  • Guest
    Reply
    |
    Mar 30, 2021

    This RFE is being investigated

  • Guest
    Reply
    |
    Mar 24, 2021

    @Rune

    Hi, "date" and "timestamp" are not COBOL types, and values can't be determined at compile time.

  • Guest
    Reply
    |
    Mar 2, 2021

    Nice RFE :-)

    I would like to add a wish for MAX-DATE, MIN-DATE, MAX-TIMESTAMP and MIN-TIMESTAMP, as these values are also used a lot, and are currently residing in copybooks.

    Regards,
    Rune