• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Using APIs to Send Impromptu Messages, Take Two

    January 17, 2007 Hey, Ted

    The code for this story is available for download here.

    In your article, Using APIs to Send Impromptu Messages, you show how to use a message subfile to display impromptu error messages from an RPG program. The logic works great if you call the message-handling APIs from the main logic. However, when I move the API calls into subprocedures, your technique breaks down. What do I need to do?

    –Chris

    The problem is that you are now sending messages from a different call stack entry. (I hesitate to use the terms “higher” and “lower” when talking about call stack entries, as they tend to confuse.) Fortunately, this is easy to fix.

    Here are the calls from the article you mention.

    SendMsg (*blanks: *blanks : Msg : %size(Msg): '*INFO': '*': 0:
             *blanks: ErrorDS); 
    ClrMsgQ ('*': *zero: *blanks: '*ALL': ErrorDS);
    

    Notice the sixth and seventh parameters of QMHSNDPM, and first two parameters of QMHRMVPM. These refer to the call stack entry and call stack counter. The asterisk in the first of those two parameters and the zero in the second one together point to the current call stack entry.

    The simple solution is to replace the asterisk with the program name, which you already have because you need it for the display file.

    QMHSNDPM (*blanks: *blanks : Msg : %size(Msg):
                       '*INFO': PgmNam: 0: *blanks: ErrorDS);
    QMHRMVPM (PgmNam: *zero: *blanks: '*ALL': ErrorDS);
    

    I have revised the example program from the previous article so that it uses subprocedures. The RPG and DDS code are available for download.

    I’m glad to see you using subprocedures. I keep telling myself that I am going to quit using subroutines completely, but I haven’t done so yet.

    –Ted

    RELATED STORY

    Using APIs to Send Impromptu Messages



                         Post this story to del.icio.us
                   Post this story to Digg
        Post this story to Slashdot

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    ARCAD Software

    [Webinar Series] Demystifying DevOps on the IBM i

    Join us for this 3-Part Roundtable Webinar Series, where ARCAD experts will demystify the move to Git and an automated process with options that work for everyone!

    This Series will be an engaging discussion on key DevOps topics as Git, Builds, Automation and much more.

    Part 2: Branching & Building (Thursday, February 9th, at 12:00PM ET / 9:00AM PT)

    During this 2nd session, we will discuss Feature/Release and Branch Management and building the branches with tools like Bob and ARCAD.

    Part 3: DevOps – Automated Workflow (Thursday, February 23rd, at 12:00PM ET / 9:00AM PT)

    During this 3rd session, we will discuss what can be automated in the IBM i DevOps process starting from the build to other steps in your workflow.  We’ll discuss pipeline tools like Jenkins and the new automation features of Git packages.

    Register NOW

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    BCD:  Try WebSmart - the easiest and most complete iSeries Web development tool
    COMMON:  Join us at the 2007 conference, April 29 – May 3, in Anaheim, California
    New Generation Software:  Leading provider of iSeries BI and financial management software

    IBM to Open Eight SOA Centers Worldwide Big Blue Readies Revamped Storage for the System i

    Leave a Reply Cancel reply

Volume 7, Number 2 -- January 17, 2007
THIS ISSUE SPONSORED BY:

WorksRight Software
SEQUEL
Patrick Townsend & Associates

Table of Contents

  • Using APIs to Send Impromptu Messages, Take Two
  • Gotcha Lurking in Datalink File Manager for DB2/400
  • Admin Alert: Ending Subsystems Properly

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • Power Systems Did Indeed Grow Revenues Last Year
  • The IBM Power Trap: Three Mistakes That Leave You Stuck
  • Big Blue Decrees Its 2023 IBM Champions
  • As I See It: The Good, the Bad, And The Mistaken
  • IBM i PTF Guide, Volume 25, Number 5
  • N2i Gains Traction Among IBM i Newbies
  • Realizing The Promise Of Cross Platform Development With VS Code
  • 2023 IBM i Predictions, Part 3
  • Four Hundred Monitor, January 25
  • Join The 2023 IBM i Marketplace Survey Webinar Tomorrow

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2022 IT Jungle

loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.