Maybe this example will help (QN EXEC):

/*   QUERY NAMES replacement
*/

  Trace "O"


  Address "COMMAND"


  "PIPE (endchar ?)",


      "|  CP QUERY NAMES",


      "|  ZONE 9.1 NFIND -"||,


      "|  SPLIT ,",


      "|  STRIP",


      "|o:FANOUT",


      "|  SORT",


      "|  SPEC 1.15 1.16",


      "|  SNAKE 5",


      "|i:FANIN",


      "|  CONSOLE",


    "?o:",


      "|  COUNT LINES",


      "|  SPEC /  Total number of users = / 1 1-* NW",


      "|j:FANIN",


      "|  JOIN *",


      "|i:",


    "?o:",


      "|  SPEC FS - F2 STRIP 1",


      "|p:FIND DSC"||,


      "|  COUNT LINES",


      "|  SPEC /  disconnected = / 1 1-* NW", 

      "|  j:"                                 

Exit rc                                       

 

 

Frank M. Ramaekers Jr.

 

 

________________________________

From: The IBM z/VM Operating System [mailto:ib...@listserv.uark.edu] On
Behalf Of Sergio Lima
Sent: Wednesday, January 05, 2011 6:45 AM
To: IBMVM@LISTSERV.UARK.EDU
Subject: PIPE locate question

 

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


_____________________________________________________
This message contains information which is privileged and confidential and is 
solely for the use of the
intended recipient. If you are not the intended recipient, be aware that any 
review, disclosure,
copying, distribution, or use of the contents of this message is strictly 
prohibited. If you have
received this in error, please destroy it immediately and notify us at 
privacy...@ailife.com.

Reply via email to