Victor,

If I were going to do something like this, I would just build the
commands in the pipe and send them to CP.

'pipe < guest list a',
'| spec /send/ 1 w1 nw /start-stop.sh/ nw ',
'| cp'

For each guest in the list a seperate cp command will be sent.  So no
need to manually parse the list.  Verify the output by replacing the
CP stage with CONS.

If you need to run the commands staggered by some time limit you could
do this...

'pipe < guest list a',
'| spec /send/ 1 w1 nw /start-stop.sh/ nw ',
'| stem comms.'

do i=1 to comms.0
  'cp' comms.i
  'wakeup +00:00:10'
end

Kyle Black


On Sun, Aug 8, 2010 at 7:42 AM, Berry van Sleeuwen
<[email protected]> wrote:
> We run such a process but not within one pipeline. The rexx exec runs in a
> PROP user that monitors the linux guests. I do like PIPE so there are some
> pipelines inside the exec.
>
> 1. When our CMS scheduler sends command KICK_LINUX the exec will build a
> list of commands. Basically your step 1.
> 2. When a Linuxguest issues KICK_LINUX the command for that user is removed
> from the list. Basically your step 3.
> 3. Everytime KICK_LINUX is called the first line of the list is send to the
> linuxuser in that line.
>
> This way the exec doesn't have to wait for a script to end. And during that
> time PROP has control so any message, either related to KICK_LINUX or not,
> will still be processed by PROP.
>
> The only problem is that we can't tell if the sequence has stalled. If
> guest3 doesn't return the KICK_LINUX message guest4 will never be triggered.
> I guess your step 4 will tell you if it has stalled (or rather when it
> doesn't tell you...). Since we run automatically I would prefer the other
> way: 'Your sequence has stalled. Please call System support.' but I haven't
> figured out how to detect a stall.
>
> Regards, Berry.
>
> Op 08-08-10 10:31, Victor Ochoa Avila schreef:
>
> Thanks by the answers, but specifically this is what I want
>
> 1.- first I obtain the list of guests active.
>
> pipe cp q n| split /,/ | specs w1 1 | locate /CMP/ | > GUESTS LISTS A
> Note: "CMP" is my pattern for guests in production mode in this partition.
> For example: CMPWAPE1, CMPWSPE1, CMPDBPE1
> My lists is
> CMPWAPE1
> CMPWSPE1
> CMPDBPE1
> 2.- I am going to send  this command to each guests linux of this list
>       cp send CMPWAPE1 start-stop.sh
> 3.- When this script finalize I need to erase this guets of the file "GUESTS
> LISTS A"  AND count the elements, to know if file is empty.
> 4.- if file is empty  then I finish to the process and sent a message
> "All the guets were process"
> 5.- If file isn't empty take the next guest name in file and return to step
> 2.
> I do not know I can realise this loop with a pipe ?
>
> Thanks to all by your help
> ATTE
> VIctor Hugo
>
>
>
>
>
> 2010/8/7 Hughes, Jim <[email protected]>
>>
>> Nice catch.  My brain didn't get engaged while the fingers were
>> typing.....
>>
>> _____________________
>> Jim Hughes
>> x5586
>> "It is fun to do the impossible." Quote from Walt Disney
>>
>> ________________________________
>>
>> From: The IBM z/VM Operating System on behalf of Rob van der Heij
>> Sent: Sat 8/7/2010 8:48 AM
>> To: [email protected]
>> Subject: Re: pipe question?
>>
>>
>>
>> On Sat, Aug 7, 2010 at 12:43 PM, Hughes, Jim <[email protected]>
>> wrote:
>> > "pipe (endchar ?)  ",
>> > ? < guests list a   ",
>> > "|  bld:  take 1    ",
>> > "| > guests list a ",
>> > "? bld:   ",
>> > your process follows
>>
>> You meant to "drop" rather than "take" to leave all but the first
>> record in the file. But it's an elegant style to divert the record to
>> process towards the end of the pipeline (so you don't forget to keep
>> the remainder). And real plumbing would be to handle them all, not
>> just one of them (but that's beyond the question).
>>
>> | Rob
>
>
>
> --
> Victor Hugo Ochoa Avila
> z/OS & z/VM systems programmer
> Mexico, City.
>

Reply via email to