RXS reads and writes queues defined in IBM Webspere MQSeries. Any changes on queues during the access are committed, provided the RXS program ends normally. If the program ends in error (error related to MQSeries or any other error), if the user leaves the program reversing out through the first window of the dialogue (according to Section 21a), or if the RXS program terminates in a programmed exit or return, then all MQSeries changes are rolled back.
mq
General order mq contains the name of the actual MQSeries system. mq may only be given one value in a RXS program: a RXS program cannot access several MQSeries queue managers. Default value for mq is stated at installation of RXS.
In RXS, a MQ message can hold up to 16 MB of data.
in
For func='mqbrowse' the name of the queue to read from is stated in general order in.
readlim
As general order for the action block may be stated readlim: the maximum number of messages to be read. Default for readlim is 3,000,000.
The reading assigns values to these variables:
unit.1 |
Contains the current message |
mq_backout |
Backout-count, that is the number of times this message previously has been read in vain, because of rollbacks in a reading application |
mq_messid |
Message-ident: a 24 character field containing the unique key assigned to the message by MQSeries |
mq_putdate |
Date at which the message was created on the queue |
mq_puttime |
Time at which the message was created on the queue (Greenwich mean time) |
mq_applname |
A name of the application which created the message on the queue |
mq_appltype |
The environment of the application that created the message on the queue (CICS, DOS, AIX, MVS, OS390, WINDOWS...) |
Each message triggers the action block. In MQSeries terms, 'mqbrowse' is a MQGET with the browse-flag set.
func='mqdrain' functions like func='mqbrowse', but reading is destructive, meaning that the accessed queue is empty after reading. In MQSeries terms, 'mqdrain' is a normal MQGET. A value in readlim will limit the destructive reading, for instance readlim=30 will read and delete the 30 oldest messages on the queue.
mq_messid
func='mqdrainkey' works like func='mqdrain', but only one message is read. The message to be read is stated in general order mq_messid (24 character MQ-message-id).
Reading is destructive, meaning that the one message read is removed from the queue.
Example 27.1
)action in='ourqualf.inpque'
)& func='mqbrowse'
if substr(unit.1,4,10) = '2007-01-06' then do
foundmess=mq_messid
)action in='ourqualf.inpque'
)& func='mqdrainkey'
)& mq_messid=foundmess
"Deleted: "left(unit.1,40)
)endaction
end
)endaction
The program deletes all messages having date '2007-01-06' from the stated queue. The date is located in position 4 in the messages and is 10 bytes long. A report is written on <user>.RXS.DATA containing the first 40 byte of every deleted message.
out outfunc
If an action block has outfuc='mqput' output will be written to the MQSeries queue named by general order out.
Example 27.2
)action out='ourqualf.thisque'
)& outfunc='mqput'
)& mq='mqdc'
"What hath God wrought?"
"One small step for man, a giant leap for mankind"
)endaction
This RXS program writes two messages on the MQSeries queue 'ourqualf.thisque'. The queue belongs to MQSeries system 'mqdc'. mq_putappltype is set to 'OS390' and mq_putapplname is set to the current userid.