COBOL samples

 

Messages must be in the following format to be read from a queue:

  UPDATE Balance change=snnnnnnnn WHERE Account=nnnnnnnn
For simplicity, the Balance change must be a signed eight-character number and the Account must be an eight-character number.

The sample AMQSPUT can be used to put the messages on the queue.

The samples take no parameters and use the default queue manager. It can be configured to run only one of the samples at any time. Assuming that you have configured the default queue manager for the single database sample, with a queue called singDBQ, you increment Mr Fred Bloggs’s account by 50 as follows:

  AMQSPUT singDBQ
Then key in the following message:
  UPDATE Balance change=+00000050 WHERE Account=00000001
We can put multiple messages on the queue:
  AMQ0XAS0
Type in the name of the queue:
  singDBQ
The updated status of Mr Fred Bloggs’s account is then printed.

Assuming that you have configured the default queue manager for the multiple database sample, with a queue called multDBQ, you decrement Ms Mary Brown’s account by 75 as follows:

  AMQSPUT multDBQ
Then key in the following message:
  UPDATE Balance change=-00000075 WHERE Account=00000003
You can put multiple messages on the queue:
  AMQ0XAG0
Type in the name of the queue:
  multDBQ
The updated status of Ms Mary Brown’s account is then printed.

 

Parent topic:

Running the samples


fg17790_