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 Delivered
Categories Other
Created by Guest
Created on Apr 14, 2010

alteration of the returned result of the EGL function mathlib.precision() (RTC 46267)

Environment: Windows
Product name: IBM? Rational? Business Developer
Program Version : 7.5.1.4
Description.
My EGL program code when running as generated Java with the function precision() returns unexpected results for us when called with parameter of type decimal but correct result if the parameter is numeric ie.

program tstedt type BasicProgram{}
Prec2 decimal(2,1);
Prec4 decimal(4,2);
Prec2n num(2,1);
Prec4n num(4,2);
function main()
// Decimal wrong
syslib.writeStdout("Precision should be 2: <" + mathLib.precision(Prec2) + ">");
syslib.writeStdout("Decimals should be 1: <" + mathLib.decimals
(Prec2) + ">");
syslib.writeStdout("Precision should be 4: <" + mathLib.
precision(Prec4) + ">");
syslib.writeStdout("Decimals should be 2: <" + mathLib.decimals
(Prec4) + ">");
// Numeric OK
syslib.writeStdout("Precision should be 2: <" + mathLib.
precision(Prec2n) + ">");
syslib.writeStdout("Decimals should be 1: <" + mathLib.decimals
(Prec2n) + ">");
syslib.writeStdout("Precision should be 4: <" + mathLib.
precision(Prec4n) + ">");
syslib.writeStdout("Decimals should be 2: <" + mathLib.decimals
(Prec4n) + ">");
end
end

Produces output on console:
Precision should be 2: <3>
Decimals should be 1: <1>
Precision should be 4: <5>
Decimals should be 2: <2>
Precision should be 2: <2>
Decimals should be 1: <1>
Precision should be 4: <4>
Decimals should be 2: <2>

RBD development have informed us (via PMR 71531,SGC,724) that this is working as designed ie.
A decimal variable stores its data this way, two digits are stored in each byte, except for the last byte which holds one digit and the sign. This means there are always an odd number of digits. When you declare a decimal with an even length in EGL, you actually get that length + 1, except the maximum length is 32.
Prec2 decimal(2,1) = 12.3; // This does NOT overflow. The variable is actually a decimal(3,1).
The money and pacf types use a similar storage format to decimal, so they work the same, Num and numc do not.

Idea priority Medium
  • 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 - Business Developer

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

  • Guest
    Reply
    |
    Dec 9, 2010

    This is now available in version 8.0.1

  • Guest
    Reply
    |
    May 6, 2010

    This RFE's Headline was changed after submission to reflect the headline of an internal request we were already considering, but will now track here.

  • Guest
    Reply
    |
    May 6, 2010

    In a future release, we will look into the possibility of providing an option to have precision work the way that you suggest. The default would remain the way that EGL currently behaves, to ensure consistency for other users.