Topic
3 replies Latest Post - ‏2012-11-26T14:01:04Z by JohnxLong
JohnxLong
JohnxLong
59 Posts
ACCEPTED ANSWER

Pinned topic RPG Send message to command line

‏2012-11-23T12:48:41Z |
Hi All,

It's Friday afternoon and my brain has gone completley blank, or maybe its my age.

I have an RPG pgm that is called from a command in QCMDSRC, I want to send a message back that is displayed on the command line once the pgm has ended

Whats the command?

Thanks in advance

John
Updated on 2012-11-26T14:01:04Z at 2012-11-26T14:01:04Z by JohnxLong
  • scott_klement
    scott_klement
    242 Posts
    ACCEPTED ANSWER

    Re: RPG Send message to command line

    ‏2012-11-25T05:29:48Z  in response to JohnxLong
    What you want to do is send a *COMP (completion) message -- that's assuming that you're not reporting an error -- but just want to let the user know that all went well.

    For an error, you want to send an *ESCAPE message instead. The caller will receive this as an exception.

    There's no "command", per se, in RPG to send these. Instead, you'd want to call the Send Program Message (QMHSNDPM) API

    From CL, however, there is a command -- SNDPGMMSG.
    • JohnxLong
      JohnxLong
      59 Posts
      ACCEPTED ANSWER

      Re: RPG Send message to command line

      ‏2012-11-26T12:46:40Z  in response to scott_klement
      Thanks Scott, just what I was after.

      I've set that up, the message is appearing in my joblog but not at the bottom of the screen, I'm clearly missing something.

      Any ideas?

      John
      • JohnxLong
        JohnxLong
        59 Posts
        ACCEPTED ANSWER

        Re: RPG Send message to command line

        ‏2012-11-26T14:01:04Z  in response to JohnxLong
        Sorted it, I had to change the call stack counter to push it back a couple of levels, its now working like a charm,

        Thanks for the help

        John