Queue Manager Manual
Example: COBOL Application
B–10 46517 Tandem Computers Incorporated
* Wait for the user to press a function key. The order of the UNTIL
clause
* will define the order of values assigned in TERMINATION-STATUS.
*
IF wc-error-status NOT = 0
MOVE wc-error-status TO wa-term-status
MOVE wc-error-substatus TO wa-term-substatus
MOVE LOW-VALUES TO wc-error
ELSE
MOVE SPACES TO wa-error-text
MOVE ZEROS TO wa-term-status, wa-term-substatus.
PERFORM display-screen.
ACCEPT workout-scrn
UNTIL
enq-key, deq-key, waitq-key, (return-key, exit-key).
PERFORM ONE OF
do-enq, do-deq, do-waitq, do-exit
DEPENDING ON TERMINATION-STATUS.
/
DISPLAY-WORKOUT SECTION.
*
* Put up the screen from scratch, including all data for FROM and
USING fields
* in the screen definition.
*
DISPLAY BASE workout-scrn.
DISPLAY workout-scrn.
MOVE SPACES TO wa-error-text.
MOVE ZEROS TO wa-term-status, wa-term-substatus.
DISPLAY-SCREEN SECTION.
*
* Module independent interface for shared code to redisplay the
screen.
*
PERFORM display-workout.
/
DO-DEQ SECTION.
*
* User entered the DEQ key. Use the screen data to get a bunch of
requests
* from the queue.
*
MOVE wc-queue-name TO uow-deq-queue-name.
MOVE 0 TO uow-deq-priority.