IBM Support

RPG Cafe: Spring 2024: More options for SND-MSG

News


Abstract

Information about the PTFs to provide the ILE RPG enhancement for the SND-MSG operation code

Content

You are in: RPG Cafe > RPG Cafe: Spring 2024: More options for SND-MSG

Short URL: https://ibm.biz/rpgcafe_spring_2024_snd_msg_update

Spring 2024: More options for SND-MSG

See New messaging opcodes SND-MSG and ON-EXCP for basic information about SND-MSG, including a run-time PTF that you need on any system where you run a program that uses SND-MSG, .

  • More messsage types in addition to the existing *INFO and *ESCAPE message types.
    • *COMP for a completion message
    • *DIAG for a diagnostic messsage
    • *NOTIFY for a notification message
    • *STATUS for a status message
  • More special values for %TARGET
    • *CTLBDY, the "control boundary" which is the first call-stack entry in the sequence of entries that are in the same activation as the procedure using SND-MSG.
    • *PGMBDY, the "program boundary" which is the first call-stack entry in the sequence of entries that are in the same program or service program as the procedure using SND-MSG.
    • *EXT, the "external message queue".

See https://www.ibm.com/docs/en/ssw_ibm_i_75/apis/QMHSNDPM.htm for more information about the underlying support for SND-MSG.

Example using some new options for SND-MSG

The program simulates performing a long-running task in an interactive job. A status message is issued at the bottom of the screen indicating the progress of the program, and a completion message is issued at the end of the program. The "work" done by this program is simulated by a call to the usleep() function to sleep for 1000 microseconds.

          ctl-opt dftactgrp(*no);
          dcl-s i int(10);
          dcl-pr usleep extproc(*dclcase);
             micro_seconds uns(10) value;
          end-pr;

          for i = 1 to 1000;
             if %rem(i : 100) = 0;
                // Show a message at the bottom of the screen
                snd-msg *status %char(i) + ' items completed' %target(*ext)
             endif;
             usleep (1000); // Do some "work"
          endfor;

          // Send the completion message to the caller of this program
          snd-msg *comp 'Work is complete' %target(*pgmbdy : 1);
          return;

.                                                            .
.                                                            .

PTFs for 7.4 and 7.5

7.4:

  • ILE RPG compiler: 5770WDS SJ01353

7.5:

  • ILE RPG compiler: 5770WDS SJ01351
  • ILE RPG compiler, TGTRLS(V7R4M0): 5770WDS SJ01354

The PTFs will also be available with later Db2 for i Fix Packs. See Db2 for IBM i 2022 PTF Group Schedule.

RDi support

The next update for RDi will support these enhancements.

Documentation

The 7.4 and 7.5 ILE RPG Reference and ILE RPG Programmer's Guide are updated with full information about these enhancements.

[{"Type":"MASTER","Line of Business":{"code":"LOB73","label":"Power TPS"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SS69QP","label":"Rational Development Studio for i"},"ARM Category":[{"code":"a8m0z0000000C4BAAU","label":"IBM i"}],"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.4.0;7.5.0;and future releases"}]

Document Information

Modified date:
15 July 2024

UID

ibm17149564