SGET (imqsget.cpp), SGET (imqsget), SPUT (imqsput), SPUT sample program, SGET sample program, placing on named queue, example, messages, retrieving from named queue, placing messages on named queue, retrieving messages from named queue, putting messages on, queue, retrieving messages from" /> Sample programs SPUT (imqsput.cpp) and SGET (imqsget.cpp)

 

Sample programs SPUT (imqsput.cpp) and SGET (imqsget.cpp)

These programs place messages to, and retrieve messages from, a named queue.

 

On all platforms except z/OS

  1. Run imqsputs queue-name.

  2. Type in lines at the console, which are placed with WebSphere MQ as messages.

  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.

 

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.

See Running sample programs on z/OS for more information.

These samples show the use of the following classes: