What about this:
"PIPE CP QUERY NAMES | SPLIT , | STRIP | LOCATE /- DSC/ ",
   " | sort 1-8 | > mach disc a",
   "|| locate /xxxxx/ | console | count lines |Var NbFound"
If NbFound=0 then do
   say 'Nothing found for xxxxx' ; exit 67; end

Remark that I made one big pipe of the 3 ones you used.  There is no
need to work with intermediate files.  And, maybe you don't need the
file at all, if so, you can remove
   | > mach disc a
too.

By the way, my LISTS package on the VM download library has a USERLIST EXEC:
  USERLIST             lists all users
  USERLIST *xxx*    lists all users with xxx in their name
It givs a FILELIST like interface.

Kris Buelens

2011/1/5, Sergio Lima <sergiovm...@hotmail.com>:
>
> Hello List,
>
> As I learned in this list, I'm trying to use PIPE in some cases instead
> REXX.
>
> Now, We need see from time to time, if some machines are running in
> disconnect mode.
>
> Then write this sample PIPE, that put in a file, all machines that is run in
> disconnect mode, and then try locate that We need.
>
> trace r
> "PIPE CP QUERY NAMES | SPLIT , | STRIP | LOCATE /- DSC/ | > mach disc a"
> "pipe < mach disc a | sort 1-8 | > mach disc a"
> "pipe < mach disc a | locate /xxxxx/ | console"
> say rc
> exit
>
> The problem, is that the RC (Return Code) always return 0, if the string
> exist or not.
>
> For example :
>
> My file :
>
>  MACH     DISC
>  ===>
> CONNECT  - DSC
> CPUVM    - DSC
> DEFCICS  - DSC
> DISKACNT - DSC
> FTPSERVE - DSC
> GCS      - DSC
> LPSERVE  - DSC
> OPERATOR - DSC
> OPERSYMP - DSC
> OP1      - DSC
> OP2      - DSC
> PERFSVM  - DSC
>
> Running the EXEC :
>
> With NOT FOUND :
>
>      3 *-* "PIPE CP QUERY NAMES | SPLIT , | STRIP | LOCATE /- DSC/ | > mach
> disc
>  a"
>
>        >>>   "PIPE CP QUERY NAMES | SPLIT , | STRIP | LOCATE /- DSC/ | >
> mach di
> sc a"
>
>      4 *-* "pipe < mach disc a | sort 1-8 | > mach disc a"
>
>        >>>   "pipe < mach disc a | sort 1-8 | > mach disc a"
>
>      5 *-* "pipe < mach disc a | locate /xxxxx/ | console"
>
>        >>>   "pipe < mach disc a | locate /xxxxx/ | console"
>
>      6 *-* say rc
>
>        >>>   "0"
>
> 0
>
>      7 *-* exit
>
>
>
> With FOUND :
>
>      3 *-* "PIPE CP QUERY NAMES | SPLIT , | STRIP | LOCATE /- DSC/ | > mach
> dis
>  a"
>
>        >>>   "PIPE CP QUERY NAMES | SPLIT , | STRIP | LOCATE /- DSC/ | >
> mach d
> sc a"
>
>      4 *-* "pipe < mach disc a | sort 1-8 | > mach disc a"
>
>        >>>   "pipe < mach disc a | sort 1-8 | > mach disc a"
>
>      5 *-* "pipe < mach disc a | locate /CPUVM/ | console"
>
>        >>>   "pipe < mach disc a | locate /CPUVM/ | console"
>
> CPUVM    - DSC
>
>      6 *-* say rc
>
>        >>>   "0"
>
> 0
>
>      7 *-* exit
>
>
> Looking in the Manual CMS PIPELINES REFERENCE, Can't see how get the Return
> Code.
>
> Please, someone can help us with this question?
>
> Thanks very much
>
> Sergio Lima Costa
> Sao Paulo - Brazil                                    


-- 
Kris Buelens,
IBM Belgium, VM customer support

Reply via email to