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:

Follow the appropriate instructions to run the programs.


On all platforms except z/OS

  1. Run imqsputs queue-name.
  2. Type lines of text at the console. These lines are placed as messages onto the specified queue.
  3. Enter a null line to end the input.
  4. 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

  1. Construct and run a batch job using the sample JCL imqsputr. The messages are read from the SYSIN data set.
  2. 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