You can use lookup to process a list. I haven't tested this but something like:
/* */ parse arg input PIPE (END \) CP QUERY NAMES, | SPLIT, | LOCATE /- DSC/, | sort 1-8, | pad 8 /* Make sure length 8 */ | a: lookup 1.8 1.8, /* Compare */ | count lines, | var iffound, /* number of names found */ \ var input, /* names parsed from commandline */ | split, | pad 8, /* make sure length 8 */ | a:, | count lines, /* number of names not found */ | var ifnotfound Regards, Berry. Op 05-01-11 14:30, Sergio Lima schreef: > Hello Kris, > > Thanks very much, run very well, look please : > > 3 *-* "PIPE CP QUERY NAMES | SPLIT , | STRIP | LOCATE /- DSC/ "," > | SORT 1- > 8 | > MACH DISC A"," | LOCATE /XXXXX/ | CONSOLE | COUNT LINES |VAR > NBFOUND" > >>> "PIPE CP QUERY NAMES | SPLIT , | STRIP | LOCATE /- DSC/ > | SORT 1- > 8 | > MACH DISC A | LOCATE /XXXXX/ | CONSOLE | COUNT LINES |VAR > NBFOUND" > 6 *-* IF > NBFOUND=0 > >>> > "1" > *-* > THEN > *-* > DO > 7 *-* SAY 'NOTHING FOUND FOR > XXXXX' > >>> "NOTHING FOUND FOR > XXXXX" > NOTHING FOUND FOR > XXXXX > *-* EXIT > 67 > >>> > "67" > > > So one more thing , if not slow you down, Do you have idea, how can I > execute this same command to 8 cms machines ? > > Better use a variable under LOCATE COMMAND , and do a loop 8 times ? , > or not ? > > Thanks again Kris, about the PIPE COURSE, I already have download here > in my machine, and, always that have time, i try learn more. > This course is very good. > > Best Regards, > > Sergio > > > Date: Wed, 5 Jan 2011 14:12:33 +0100 > > From: kris.buel...@gmail.com > > Subject: Re: PIPE locate question > > To: IBMVM@LISTSERV.UARK.EDU > > > > 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