REXX - question about rxqueue - OS2

This is a discussion on REXX - question about rxqueue - OS2 ; Hello, I use the following code to pass data between programs: address cmd script.cmd | rxqueue By using queued() and "parse pull txt" (or txt = linein("QUEUE:")) in program2 I can retrieve whatever was put into a queue by script.cmd. ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: REXX - question about rxqueue

  1. REXX - question about rxqueue

    Hello,
    I use the following code to pass data between programs:
    address cmd script.cmd | rxqueue
    By using queued() and "parse pull txt" (or txt = linein("QUEUE:")) in
    program2 I can retrieve whatever was put into a queue by script.cmd.
    I adapted this to run from a VxRexx program. When the program runs
    standalone, the data is retrieved as expected. But when the program is
    integrated with the rest of the system, the data is "lost," i.e., it is
    not retrieved since the queue in program2 is not that used by rxqueue in
    script.cmd. It is not program2's "session" queue, or any other queue I can
    find.
    So my question is: What queue does rxqueue use/create when it is used
    as above with data piped to it?

    --
    jmm dash list (at) sohnen-moe (dot) com
    (Remove .AXSPAMGN for email)

  2. Re: REXX - question about rxqueue

    On Wed, 5 Jan 2005 16:57:50 UTC, Jim Moe
    wrote:

    > Hello,
    > I use the following code to pass data between programs:
    > address cmd script.cmd | rxqueue
    > By using queued() and "parse pull txt" (or txt = linein("QUEUE:")) in
    > program2 I can retrieve whatever was put into a queue by script.cmd.
    > I adapted this to run from a VxRexx program. When the program runs
    > standalone, the data is retrieved as expected. But when the program is
    > integrated with the rest of the system, the data is "lost," i.e., it is
    > not retrieved since the queue in program2 is not that used by rxqueue in
    > script.cmd. It is not program2's "session" queue, or any other queue I can
    > find.
    > So my question is: What queue does rxqueue use/create when it is used
    > as above with data piped to it?
    >


    Does the use of 'address cmd' within the VXRexx program create
    another, separate session? See the section on the Queue Interface in
    the Rexx on-line manual - each session has its own session queue which
    is not accessible to other sessions. I've used queues with VXRexx on a
    number of occasions and I always create a specific, named queue and
    use that in both programs/threads. So, in Program1:

    queuename = rxqueue('create', 'programqueue')
    oldqueue = rxqueue('Set', 'programqueue')

    /* from now on all queue actions apply to programqueue */

    In Program2:

    oldqueue = rxqueue('set', 'programqueue')

    /* from now all all queue actions apply to programqueue */

    This assumes that Program1 is started before Program2 or is
    synchronized in some way. Can you modify your program to use a similar
    approach?

    --
    Regards

    Sid Gale

  3. Re: REXX - question about rxqueue

    sid@nospamaddress.co.uk wrote:
    >
    >> I use the following code to pass data between programs:
    >> address cmd script.cmd | rxqueue
    >> So my question is: What queue does rxqueue use/create when it is used
    >>as above with data piped to it?

    >
    > Does the use of 'address cmd' within the VXRexx program create
    > another, separate session? [...]
    >

    I believe so. It is named the "session" queue?
    I have read the docs, both online and the "Bark to Byte" redbook.
    Neither discuss the use of "... | rxqueue".

    > [...] I've used queues with VXRexx on a
    > number of occasions and I always create a specific, named queue and
    > use that in both programs/threads. [...]
    >

    Yes, that is what I do as well to send commands to an independent
    program started by the main application. The main app creates a command
    queue for the new program, and uses "address cmd newprogram.exe con"
    to start it.
    Then the new program at some point uses "address cmd script.cmd | rxqueue".

    Using "... | rxqueue" apparently uses or creates its own queue that may
    be separate from the program's queue. What could it be?

    --
    jmm dash list (at) sohnen-moe (dot) com
    (Remove .AXSPAMGN for email)

  4. Re: REXX - question about rxqueue

    On Thu, 6 Jan 2005 07:48:30 UTC, Jim Moe
    wrote:

    >
    > Using "... | rxqueue" apparently uses or creates its own queue that may
    > be separate from the program's queue. What could it be?
    >


    Investigation reveals that this rxqueue is a filter program -
    rxqueue.exe - and is documented in 'Rexx Tips and Tricks', available
    from Hobbes. It does not create its own queue but usually acts on the
    session queue (called SESSION). I think your problem is that 'address
    cmd' is creating a new session with its own session queue,
    inaccessible to other sessions, and rxqueue is using that one
    (although I'm probably wrong!). However, you can specify a queuename
    in the call or set an environment variable RXQUEUE to the name of the
    queue you want to use.

    So:

    queuename = rxqueue('Create', 'myqueue')

    address cmd script.cmd '| rxqueue 'queuename

    or some variation thereof might do what you want. When experimenting,
    I found that I had to quote the pipe into rxqueue as shown above to
    avoid a syntax error. I don't usually bother with address cmd, I just
    quote the external command - eg

    'dir c:\ | rxqueue 'queuename

    That seems to work with .cmd files, too..


    --
    Regards

    Sid Gale


  5. Re: REXX - question about rxqueue

    sid@nospamaddress.co.uk wrote:
    > Investigation reveals that this rxqueue is a filter program -
    > rxqueue.exe - and is documented in 'Rexx Tips and Tricks', available
    > from Hobbes. It does not create its own queue but usually acts on the
    > session queue (called SESSION). I think your problem is that 'address
    > cmd' is creating a new session with its own session queue,
    > inaccessible to other sessions, and rxqueue is using that one
    > (although I'm probably wrong!).


    Just to be clear, it's not the "ADDRESS CMD" itself that is doing this.
    It's the fact that he's calling another REXX script. When the new
    REXX script launches, the queue that RXQUEUE is going to use changes.
    If you launch a non-REXX application through ADDRESS CMD, it will work
    fine without specifying a queue name. For example:

    address cmd '@ifconfig lan0 | rxqueue'

    addr = ""

    do while queued() > 0
    parse pull 'inet' addr .
    end

    That has been working fine for me for quite a while to get my IP address.

    --
    [Reverse the parts of the e-mail address to reply.]


  6. Re: REXX - question about rxqueue - Solved

    Jim Moe wrote:
    > Hello,
    > I use the following code to pass data between programs:
    > address cmd script.cmd | rxqueue
    >

    Sid answered this in the comp.lang.rexx newsgroup.
    The solution is this:
    address cmd script.cmd | rxqueue QUEUNAME
    By explicitly naming the queue (QUEUNAME) I put the data where I can later
    get it. The receiving queue is created before the script is called and is
    "set" before "pull txt1".

    --
    jmm dash list (at) sohnen-moe (dot) com
    (Remove .AXSPAMGN for email)

+ Reply to Thread