Function calls on IBM i
Use this information to learn about the function calls available in IBM i programming.
Conventions used in the call descriptions on IBM i
For each call, this collection of topics gives a description of the parameters and usage of the call. This is followed by typical invocations of the call, and typical declarations of its parameters, in the RPG programming language.
Important: When coding IBM MQ API calls we must ensure that all relevant parameters (as described in the following sections) are provided. Failure to do so can produce unpredictable results. The description of each call contains the following sections:
- Call name
- The call name, followed by a brief description of the purpose of the call.
- Parameters
- For each parameter, the name is followed by its data type in parentheses ( ) and its direction; for example:
CMPCOD (9-digit decimal integer) - output
There is more information about the structure data types in Elementary data types. The direction of the parameter can be:- Input
- You (the programmer) must provide this parameter.
- Output
- The call returns this parameter.
- Input/output
- We must provide this parameter, but it is modified by the call.
There is also a brief description of the purpose of the parameter, together with a list of any values that the parameter can take.
The last two parameters in each call are a completion code and a reason code. The completion code indicates whether the call completed successfully, partially, or not at all. Further information about the partial success or the failure of the call is given in the reason code.
- Usage notes
- Additional information about the call, describing how to use it and any restrictions on its use.
- RPG invocation
- Typical invocation of the call, and declaration of its parameters, in RPG.
Other notational conventions are:
- Constants
- Names of constants are shown in uppercase; for example, OOOUT.
- Arrays
- In some calls, parameters are arrays of character strings with a size that is not fixed. In the descriptions of these parameters, a lowercase n represents a numeric constant. When you code the declaration for that parameter, replace the n with the numeric value you require.
- MQBACK (Back out changes) on IBM i
The MQBACK call indicates to the queue manager that all of the message gets and puts that have occurred since the last syncpoint are to be backed out. Messages put as part of a unit of work are deleted; messages retrieved as part of a unit of work are reinstated on the queue. - MQBEGIN (Begin unit of work) on IBM i
The MQBEGIN call begins a unit of work that is coordinated by the queue manager, and that may involve external resource managers. - MQBUFMH (Convert buffer into message handle) on IBM i
The MQBUFMH function call converts a buffer into a message handle and is the inverse of the MQMHBUF call. - MQCB (Manage callback) on IBM i
The MQCB call reregisters a callback for the specified object handle and controls activation and changes to the callback. - MQCLOSE (Close object) on IBM i
The MQCLOSE call relinquishes access to an object, and is the inverse of the MQOPEN call. - MQCMIT (Commit changes) on IBM i
The MQCMIT call indicates to the queue manager that the application has reached a syncpoint, and that all of the message gets and puts that have occurred since the last syncpoint are to be made permanent. Messages put as part of a unit of work are made available to other applications; messages retrieved as part of a unit of work are deleted. - MQCONN (Connect queue manager) on IBM i
The MQCONN call connects an application program to a queue manager. It provides a queue manager connection handle, which is used by the application on subsequent message queuing calls. - MQCONNX (Connect queue manager (extended)) on IBM i
The MQCONNX call connects an application program to a queue manager. It provides a queue manager connection handle, which is used by the application on subsequent IBM MQ calls. - MQCRTMH (Create message handle) on IBM i
The MQCRTMH call returns a message handle. - MQCTL (Control callback) on IBM i
The MQCTL call performs controlling actions on the object handles opened for a connection. - MQDISC (Disconnect queue manager) on IBM i
The MQDISC call breaks the connection between the queue manager and the application program, and is the inverse of the MQCONN or MQCONNX call. - MQDLTMH (Delete message handle) on IBM i
The MQDLTMH call deletes a message handle and is the inverse of the MQCRTMH call. - MQDLTMP - Delete message property
The MQDLTMP call deletes a property from a message handle and is the inverse of the MQSETMP call. - MQGET (Get message) on IBM i
The MQGET call retrieves a message from a local queue that has been opened by using the MQOPEN call. - MQINQ (Inquire about object attributes) on IBM i
The MQINQ call returns an array of integers and a set of character strings containing the attributes of an object. - MQINQMP (Inquire message property) on IBM i
The MQINQMP call returns the value of a property of a message. - MQMHBUF (Convert message handle into buffer) on IBM i
The MQMHBUF converts a message handle into a buffer and is the inverse of the MQBUFMH call. - MQOPEN (Open object) on IBM i
The MQOPEN call establishes access to an object. - MQPUT (Put message) on IBM i
The MQPUT call puts a message on a queue, distribution list or to a topic. The queue, distribution list, or topic must already be open. - MQPUT1 (Put one message) on IBM i
The MQPUT1 call puts one message on a queue or distribution list, or to a topic. The queue, distribution list, or topic does not need to be open. - MQSET (Set object attributes) on IBM i
The MQSET call is used to change the attributes of an object represented by a handle. The object must be a queue. - MQSETMP (Set message handle property) on IBM i
The MQSETMP call sets or modifies a property of a message handle. - MQSTAT (Retrieve status information) on IBM i
Use the MQSTAT call to retrieve status information. The type of status information returned is determined by the STYPE value specified on the call. - MQSUB (Register Subscription) on IBM i
The MQSUB call registers the applications subscription to a particular topic. - MQSUBRQ (Subscription Request) on IBM i
The MQSUBRQ call makes a request on a subscription.
Parent topic: IBM i Application Programming Reference (ILE/RPG)