On Friday, 07/10/2009 at 12:56 EDT, Sterling James <[email protected]> wrote: > If I have a quest, usera, running a rexx exec, REXX1, while disconnected, and > userb (priv c) issues a "SEND USERA REXX2"; > Where is the "REXX2" queued? Or how can rexx1 pull that command so it will not > execute when REXX1 ends?
There are two queues in CMS: 1. The Program Stack 2. The Terminal Input Buffer A PULL statement will read from the program stack. When the program stack is empty, PULL will read from the terminal input buffer. If the terminal input buffer is empty, then PULL will read from the console (VM READ). The QUEUED() and EXTERNALS() functions are used to determine the number of items in the program stack and terminal input buffer, respectively. So to discard things typed on the console or sent via SEND while your program was busy: do queued() + externals() pull . end Note that PULL cannot "reach around" the program stack and go directly to the terminal input buffer, which is why the program must pull things off the program stack first. This technique is considered to be an unrefined display of brute force. A polite program will not arbitrarily destroy the content of the program stack in case it was placed there prior to invocation of this program, and will jump through hoops to read and restore the program stack to its entry condition. Alan Altmark z/VM Development IBM Endicott
