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.
On all platforms except z/OS
- 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-name to retrieve all the lines and display them at the console.
See Building C++ programs on z/OS Batch, RRS Batch and CICS for more information.
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.
Parent topic: C++ sample programs