Sample programs SPUT (imqsput.cpp) and SGET (imqsget.cpp)
These C++ programs place messages to, and retrieve messages from, a named queue.
These samples show the use of the following classes:
- ImqError (see ImqError C++ class )
- ImqMessage (see ImqMessage C++ class )
- ImqObject (see ImqObject C++ class )
- ImqQueue (see ImqQueue C++ class )
- ImqQueueManager (see ImqQueueManager C++ class )
Follow the appropriate instructions to run the programs.
![[UNIX, Linux, Windows, IBM i]](ngmulti.gif)
On Multiplatforms
- Run
imqsputs queue-name. - Type lines of text at the console. These lines are placed as messages onto the specified queue.
- Enter a null line to end the input.
- Run
imqsgets queue-nameto retrieve all the lines and display them at the console.
For more information, see Building C++ programs on z/OS Batch, RRS Batch and CICS.
![[z/OS]](ngzos.gif)
On z/OS
- Construct and run a batch job using the sample JCL imqsputr. The messages are read from the SYSIN data set.
- Construct and run a batch job using the sample JCL imqsgetr. The messages are retrieved from the queue and sent to the SYSPRINT data set.