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 Submitted
Workspace IBM i
Categories Languages - RPG
Created by Guest
Created on Jul 29, 2026

Add signals keyword to declare that exceptions may be raised by RPG procedures

Summary

RPGLE currently offers no syntactic or compiler-level mechanism to indicate that a procedure may raise an exception (*ESCAPE). Developers must either read the source of every invoked procedure (when available) or defensively wrap every call in monitor / on-error blocks, which hurts readability and does not guarantee real error coverage.

This idea proposes two additions to the language:

  1. A new signals(...) keyword on dcl-proc and dcl-pr to document the exception message IDs a procedure may raise.

  2. A new ctl-opt signal(...) control option so developers or corporate standards can define the level of compiler enforcement applied to that metadata.


Motivation

Modern enterprise architectures on IBM i (layered SOA: controller → interface → business logic) rely on service modules exposing dozens of exportable procedures, many of which raise exceptions through CEE* APIs, snd-msg *ESCAPE, or custom wrappers. Today there is no standard way to:

  • Document that a procedure may fail with an exception.

  • Warn the caller if the call is not wrapped in a monitor block.

  • Enable static analysis or IDE quick-fixes in RDi or VS Code (Code for IBM i).

  • Enforce an explicit contract between service layers.

This proposal closes a language-expressiveness gap that other languages have already addressed (Java throws, Swift throws, C++ noexcept, Python type stubs Raises:).


Proposed syntax

Compiler control option:

ctl-opt signal(*NONE);   // Default — full backward compatibility, allow percolate to caller
ctl-opt signal(*WARN); // Compiler emits severity 10 message on mismatch (allow percolate to caller)
ctl-opt signal(*STRICT); // Compiler emits severity 30+ message (fails the build)


Prototype and procedure declaration:

dcl-pr GetClientStatus ind extproc(*dclcase) signals('CPF9898' : 'BAC0001');
end-pr;

dcl-proc GetClientStatus export signals('CPF9898' : 'BAC0001');
// ...
throwProc(); // sends an *ESCAPE message that percolates to the caller
end-proc;


Control option usage

/// Compilation list

// Caller with Strict signal control option
ctl-opt signal(*strict);

if GetClientStatus();
// Do miracles
endif;

// RNFXXXX Procedure GetClientStatus may raise exception messages CPF9898,
// BAC001 surround with a valid RPG handler


Suggested special values:

  • signals(*NONE) — explicitly declares the procedure raises no exceptions (analogous to C++ noexcept).

  • signals(*ANY) — declares the procedure may raise any exception (useful for QCMDEXC, MI API, CEE* wrappers).

  • Wildcard support: signals('CPF*' : 'BAC*').


Suggested monitor semantics:

  • A monitor with catch-all on-error; satisfies any declared signals().

  • on-error 'CPFxxxx' satisfies only the matching ID.

Benefits

  1. Explicit contract documentation for each procedure.

  2. Enables static analysis in RDi, VS Code, ARCAD, SonarQube.

  3. IDE quick-fixes ("wrap in monitor", "add signals()").

  4. Enforced contracts between service layers in modern IBM i architectures.

  5. Gradual adoption: *NONE default keeps 100% backward compatibility.

  6. Alignment with recent language additions (dcl-enum, on-exit, %LIST, EXTPROC(*DCLCASE)).


Backward compatibility

Fully backward compatible. Default signal(*NONE) ensures no existing program is affected. The signals() keyword is opt-in per procedure.

Any suggestions or alternatives to add this functionality are welcome.

Idea priority High
  • Guest
    Aug 19, 2026

    The CAAC has reviewed this IBM Idea and recommends that IBM view this as a high priority Idea that is important to be addressed.

    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

    Brandon Pederson - CAAC Program Manager

  • Guest
    Aug 12, 2026

    The CAAC has reviewed this IBM Idea and recommends that IBM view this as a high priority Idea that is important to be addressed.

    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

    Brandon Pederson - CAAC Program Manager