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 Not under consideration
Workspace IBM i
Categories Languages - RPG
Created by Guest
Created on Jun 13, 2025

new build in function %PASSEDVALUE

In procedures with optional parameters, the %PASSED-BIF can be used to check whether the parameters are passed. To use such a parameter, a local field must be defined and the value must be set in the local field when the parameter is passed, otherwise it must be initialized by default.

It would help to operate with a BIF like the IFNULL-Operation or even COALESCE-Operation in SQL. Code is shorter and easier to understand.

Syntax: %PASSEDVALUE(Return Parameter-Passed Condition{:replacement})


e.g.

dcl-proc myproc;

dcl-pi *n like(age);

entryBirthDate date;

entryPerDate date options(*nopass);

end-pi;

dcl-s Age packed(3);

dcl-s localPerDate date;

dcl-s dftDate date inz('2000-01-01')

// use it in EVAL-Statemts ...

localPerDate = %PASSEDVALUE(entryPerDate:%date());


// ... or in Conditions ...

if %PASSEDVALUE(entryPerDate:dftDate) > %date();

...

endif;


// ... and also as agrument for other BIFs

Age = %diff(%PASSEDVALUE(entryPerDate:%date()):entryBirthDate:*YEARS);

return age;

end-proc;



This would be another solution for same problem as it is mentioned in IBMI-I-3552.

Idea priority Medium
  • Guest
    Aug 21, 2025
    Thank you for taking the time to submit your Idea. However, IBM does not intend to provide a solution to this Idea at this time, so it is being closed.

    While the suggested built-in function might be useful in some cases, it is more likely that IBM will add the ability to specify a default value for a *NOPASS or *OMIT parameter on the parameter definition itself, as suggested in Idea IBM-I-3552 (https://ibm-power-systems.ideas.ibm.com/ideas/IBMI-I-3552).

    - IBM Power Systems Development
  • Guest
    Aug 6, 2025

    The idea of default values is nice and would work for many situations.

    But the problem that might be solved with %PASSEDVALUE() can easily be solved with %PASSED():

    if %passed(entryPerDate) and entryPerDate > %date() 
    or '2000-01-01' > %date();

     

    Due to RPGs short-cut evaluation the second part of the AND expression is only evaluated if the first part is true. If %passed() results in false, the evaluation immediately continues with the OR part of the expression.

  • Guest
    Jul 15, 2025

    Having a BIF for checking whether a value was passed for a parameter is cumbersome to use.

    It would be better IMHO to do what other common languages like JavaScript, Python, SQL etc do:
    Have a default value specified on the parameter definition.

    This could be in the form of a new keyword DEFAULT (like SQL) (or DFT or DFTVAL) for parameter definitions.

    The RPG compiler would generate code to allocate the storage for the parameter and set the storage to the default value. The value of %PASSED BIF should be as when the parameter is not passed.

    Then you just reference the parameter without having to check if it was passed, and you can still check if the parameter was passed using %PASSED.

    This would also make RPG act and look more like other programming languages, thus minimizing the learning curve for new developers.

    Christian

    CEAC member

  • Admin
    Carmelita Ruvalcaba
    Jun 24, 2025

    The CAAC has reviewed this IBM Idea and recommends that IBM not implement this request.

    We do not see the case for adding the requested function which is best handled in application code.

    Background: The COMMON Americas Advisory Council (CAAC) members have a broad range of experience in working with small and medium-sized IBM i customers. CAAC has a key role in working with IBM i development to help assess the value and impact of individual IBM Ideas on the broader IBM i community and has therefore reviewed your Idea.

    For more information about CAAC, see www.common.org/caac

    Carmelita Ruvalcaba - CAAC Program Manager