QMHSNDPM(), QMHSNDPM1(), and QMHSNDPM2()--Send Program Message for IBM PASE for i


  Syntax
 #include <os400msg.h>

 int QMHSNDPM(const char   *msgid,
              const char   *msgf,
              const void   *msgdata,
              int          msgdataLen,    
              const char   *msgtype,
              const char   *pgmq,
              int          pgmqDelta,
              int          *msgkey,
              void         *errcode);

 int QMHSNDPM1(const char  *msgid,
               const char  *msgf,
               const void  *msgdata,
               int         msgdataLen,
               const char  *msgtype,
               const char  *pgmq,
               int         pgmqDelta,
               int         *msgkey,
               void        *errcode,
               int         pgmqLen,
               const char  *pgmqQual,
               int         extWait);

 int QMHSNDPM2(const char  *msgid,
               const char  *msgf,
               const void  *msgdata,
               int         msgdataLen,
               const char  *msgtype,
               const void  *pgmq,
               int         pgmqDelta,
               int         *msgkey,
               void        *errcode,
               int         pgmqLen,
               const char  *pgmqQual,
               int         extWait,
               const char  *pgmqType,
               int         ccsid);

  Library: Standard C Library (libc.a)

  Default Public Authority: *USE

  Threadsafe: Yes

Note: These functions can only be used in an IBM® i PASE program. See the IBM PASE for i topic collection for more information about creating IBM PASE for i programs.

The Send Program Message (QMHSNDPM, QMHSNDPM1, and QMHSNDPM2) IBM PASE for i runtime functions allow an IBM PASE for i program to send a message to a program call message queue or to the job external message queue.


Parameters

These IBM PASE for i runtime functions accept the same arguments as the Send Program Message (QMHSNDPM) IBM i API, except that the IBM PASE for i functions use character string inputs that are null-terminated strings in the IBM PASE for i CCSID. IBM PASE for i runtime automatically converts input character strings to the job default CCSID and pads with blanks (as necessary) to match the fixed-length inputs required by the system API.

No conversions are done for the msgdata (input) argument and the errcode (input/output) argument because they can contain a mixture of character and binary data. The ccsid argument specifies the CCSID for character data in the msgdata argument, and users can request CCSID information for the errcode argument by using ERRC0200 format. The QMHSNDPM and QMHSNDPM1 IBM PASE for i runtime functions use the current IBM PASE for i CCSID as a default for the ccsid value passed to the system API.

See QMHSNDPM()--Send Program Message for further description of the arguments for the QMHSNDPM, QMHSNDPM1, and QMHSNDPM2 IBM PASE for i runtime functions.


Authorities

See QMHSNDPM()--Send Program Message for information about authorities required for the QMHSNDPM, QMHSNDPM1, and QMHSNDPM2 IBM PASE for i runtime functions.


Return Value

The function result is zero for normal completion. The result is nonzero if any input character string could not be converted to the job default CCSID or was too long for the QMHSNDPM API, or if the QMHSNDPM API returned error information in the errcode argument.


Usage Notes

  1. The system only creates program call message queues ILE procedures and OMI programs, so you cannot send to or receive from a program message queue for a specific function in an IBM PASE for i program.

  2. When "*" is specified for the pgmq argument, the system locates the program call message queue for an (internal) ILE procedure in service program QP2USER that is the apparent caller of any ILE procedure called by the IBM PASE for i program using IBM PASE for i runtime function _ILECALLX or _ILECALL. IBM PASE for i programs should generally use "*PGMBDY" or "*CTLBDY" instead of "*" to send messages to their caller because a variable number of program call message queues can exist between the queue identified by pgmq "*" and the queue for the ILE API that called the IBM PASE for i program.

Related Information



API introduced: V5R1

[ Back to top | IBM PASE for i APIs | APIs by category ]