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 Oct 31, 2018
Merged idea

This idea has been merged into another idea. To comment or vote on this idea, please visit IBMI-I-1321 %int() and %dec()does not allow blank character string.

Enhance %Dec, %Int, and %Float to treat blank fields as zero Merged

Currently the character to numeric BIFs treat an input of blanks as an error. This is silly and causes unnecessary logic to have to be coded to test the field for blanks before attempting to convert. This means that the BIFs cannot be used within expressions and has other ramifications when using XML-INTO and DATA=INTO as noted in the Use Case.


Use Case:

An example of this in action can be seen when using XML-INTO since the compiler effectively applies these built-ins when loading the target variables.

e.g. When processing an xml document like this:
<part><id>A1234</Id><quantity>45</quantity></part>
<part><id>B2345</Id><quantity /></part>

I want to be able to code the DS as (pseudo code not tested):

dcl-ds part Qualified Dim(99);
Id char(5);
quantity int(5);
end-ds;

Instead I have to code:
dcl-ds part Qualified Dim(99);
Id char(5);
quantity char(5);
end-ds;

And then add something like:

If part(x). quantity = *blanks;
realQuantity = 0;
else;
realQuantity = %Int(part(x). quantity);
endif;

Similar code (or usage of Monitor) is required when using DATA-INTO or indeed any time that character data must be converted to numeric via the BIFs.


Idea priority High
  • Guest
    Reply
    |
    Nov 9, 2018

    like cpytoimpf:
    ' ' --> blank
    '' --> null

    if there is an extender %int(' ':0), means cvt ' ' --> 0, then the changerequest ist ok

  • Guest
    Reply
    |
    Nov 3, 2018

    Your request is a duplicate of RFE 107245 which is an "Uncommitted Candidate". Please use that RFE to cast a vote or add a comment.

  • Guest
    Reply
    |
    Nov 1, 2018

    I am not 100% certain whether this new "blank = zero" behavior should be the default as this could cause upwards compatibility issues with existing code and applications? Perhaps a new optional parameter can be added to these BIFs to indicate when this new behavior is desired?

  • Guest
    Reply
    |
    Nov 1, 2018

    This is a duplicate.

    Se this "%int() and %dec()does not allow blank character string":
    http://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=107245

  • Guest
    Reply
    |
    Oct 31, 2018

    There have been suggestions that these BIFs be allowed to supply another default when the string is blanks. I feel this is necessary and possibly needed for data columns that are null capable in the database; allow a default of null when being used to populate a null capable column.