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 Feb 18, 2024

New op-code RCV-MSG or enhancement of ON-EXCP/ON-EXIT

When sending an escape message with SND-MSG it is easy to catch that exception with MONITOR and ON-EXCP.

But to receive the message (especially the message data), remove the message from the job log or re-send the message up the call stack, we still have to use system APIs like QMHRCVPM, QMHRMVPM or QMHRSNEM.

1. Suggestion: Receive a message

monitor;
  ...
on-error;
  rcv-msg msgId msgData;
  ...
endmon;

 

2. Suggestion: Remove a message from the job log

monitor;
  ...
on-excp 'CPF9801';
  rcv-msg *remove msgId msgData;
  ...
endmon;

 

3. Suggestion: Resend a message up the call stack

on-exit isAbnormalEnd;
  ...
  if isAbnormalEnd;
    rcv-msg *remove msgId msgData;
    snd-msg *escape %msg(msgId:'QCPFMSG':msgData) %target(*caller);
  endif;

 

Alternatively modifications of the MONITOR/ON-EXCP and ON-EXIT opcodes would be possible:

monitor;
  ...
on-excp(n) 'CPF9801'; // (n) means "no-joblog"
  ...
on-excp *all msgId msgData; // catch all prev unhandled exceptions and receive message id and data
  ...
endmon;

on-exit isAbnormalEnd msgId msgData;
  ...
  if isAbnormalEnd;
    snd-msg *escape %msg(msgId:'QCPFMSG':msgData) %target(*caller);
  endif;

 

Both forms would provide roughly the same functionality to the RPG programmer and would greatly improve the message handling capabilities.

Idea priority High
  • Guest
    Reply
    |
    Apr 25, 2024
    Thank you for taking the time to submit your Idea. After careful consideration, we know that we cannot deliver your requested enhancement soon, so it is being declined.

    For the last aspect of this Idea requesting a modification of MONITOR, ON-EXCP and ON-EXIT, there is already a similar Idea IBM-I-2040 (https://ibm-power-systems.ideas.ibm.com/ideas/IBMI-I-2040), "Allow ability to control JobLog write with On-Error". You can add comments to that Idea to expand the request to more operation codes than just ON-ERROR.

    For the other aspects of this Idea, it is unlikely that IBM will soon add operation codes to handle receiving a message or resending a message since it is possible to write procedures to handle calling the APIs for those tasks. IBM added the SND-MSG operation code to make it easy to have the joblog reflect both the sender and the target of the message. In that past, if RPG programmers wanted the joblog to reflect the sending procedure, they had to calling QMHSNDPM directly from each procedure. If they chose to have a wrapper procedure to simplify calling the API, the joblog would show the wrapper procedure as the sender, making it difficult to determine what procedure chose to send the message. With SND-MSG, the joblog shows both the procedure that sent the message and the target of the message. However, that same consideration of making the joblog useful does not apply to having a wrapper procedure to call the APIs to handle receiving a message.

    -IBM Power Systems Development
  • Admin
    Carmelita Ruvalcaba Cevallos
    Reply
    |
    Mar 12, 2024

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

    Error handling in RPG is not easy. I like this idea because its simular to a try catch.

    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