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).
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:
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 an idea.
Get feedback from the IBM team and other customers to refine your idea.
Follow the idea through the IBM Ideas process.
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.
See this idea on ideas.ibm.com
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 |
By clicking the "Post Comment" or "Submit Idea" button, you are agreeing to the IBM Ideas Portal Terms of Use.
Do not place IBM confidential, company confidential, or personal information into any field.
Hi,
ISO standard COBOL defines these functions as :
HIGHEST-ALGEBRAIC : function returns a value that is equal to the greatest algebraic value that may be represented in argument
LOWEST-ALGEBRAIC : function returns a value that is equal to the lowest algebraic value that may be represented in argument
However these functions only apply to numeric type arguments.
Hi,
In response to comments about using intrinsic functions:
the minimum and maximum values relative to a PICTURE can be determined at compile time,
using an intrinsic function suggests that the minimum and maximum values would be determined at runtime, which is an unnecessary waste of time.
Thanks.
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.
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"...
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.
Hi,
Use case for condition against a min or max value :
IF incoming-dataitem > max-value of receiveing-dataitem THEN
DISPLAY "overflow"
END-IF
This RFE is being investigated
@Rune
Hi, "date" and "timestamp" are not COBOL types, and values can't be determined at compile time.
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