Skip to Main Content
IBM Power Ideas Portal


This portal is to open public enhancement requests against IBM Power Systems products, including IBM i. 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
Workspace IBM i
Categories Languages - RPG
Created by Guest
Created on Feb 14, 2019

Enhance %DEC to recognize and accept thousands separators

Currently, the %DEC BIF interprets either/both comma and decimal -- regardless of the QDECFMT system value -- as the decimal point. If the character representation of a number contains both, error RNX0105 occurs. This should not happen.

In an international system, where system values are defined to EXPLICITLY identify the decimal character and the thousands separator character, %DEC should recognize both characters for what they have been defined to be and properly deal with them.

The same comments probably apply also to %INT and %UNS.


Use Case:

When BOTH a thousands separator and a decimal point are present, as in the string "12,345.67", error RNX0105 (A character representation of a numeric value is in error) appears.

The (IMHO bizarre) functionality of this BIF -- accepting either comma or period as the decimal point -- creates hazards of which RPG programmers must take exceptional caution to avoid.

As examples:

%DEC('123 , 456' : 9 : 2) is converted as 123.45 (two decimal places). For an American user, this is the wrong value; for a European user, it's correct.

%DEC('123 . 456' : 9 : 2) is also converted as 123.45 (two decimal places). Now, this is correct for an American user, and wrong for a European user.

%DEC('12,345.678':9:2) isn't converted at all. RNX0105 appears.

This is crazy! ;-)

The need to routinely use a "workaround" (invoking the %XLATE(',':' ':x) BIF) when using %DEC implies that there's room for improvement in the operation of this BIF.


Idea priority Low
  • Guest
    Reply
    |
    Nov 12, 2020

    IBM believes that the request described has been solved and is available with PTFs for 7.3 and 7.4.

    A new value *USEDECEDIT is supported for the EXPROPTS Control keyword. When you specify Control keyword EXPROPTS(*USEDECEDIT), the values specified by the DECEDIT keyword for the decimal point and the digit separator will be used when a character value is specified for the numeric built-in functions %DEC, %INT etc. The DECEDIT keyword defaults to DECEDIT('.'), which means that the decimal point defaults to '.' and the digit separator defaults to ','.

    PTFs for 7.3:
    - SI74559: ILE RPG runtime. Note that you need this PTF on every 7.3 system where you run your programs that use this enhancement.
    - SI74612: TGTRLS(*CURRENT) compiler

    PTFs for 7.4:
    - SI74560: ILE RPG runtime. Note that you need this PTF on every 7.4 system where you run your programs that use this enhancement.
    - SI74613: TGTRLS(*CURRENT) compiler
    - SI74614: TGTRLS(V7R3M0) compiler

    For more details, please see https://ibm.biz/rpgcafe_numeric_bif_enhancements

  • Guest
    Reply
    |
    Nov 4, 2020

    IBM agrees with the request and a solution appears to be desirable and feasible. IBM intends to provide a solution.

    The enhancement is a new value for Control keyword EXPROPTS. If you code EXPROPTS(*USEDECEDIT), the settings specified by the DECEDIT keyword for the decimal point and digit separator will be used for %DEC, %INT etc.

    See https://ibm.biz/rpgcafe_numeric_bif_enhancements for more information.

  • Guest
    Reply
    |
    Apr 21, 2020

    IBM will use this request as input to planning but no commitment is made or implied. This request will be updated in the future if IBM implements it. IBM will use votes and comments from others in the community to help prioritize this request.

    If IBM implements this feature, there will likely be a Control option to request that the %DEC etc. built-in functions respect the format specified by the DECEDIT keyword.

  • Guest
    Reply
    |
    Feb 15, 2019

    There is another notation or edit that needs to be taken into account. It is $12 234,66-. This is the standard format in places like South Africa.