Using PIPE
The PIPE command can help you solve a complex problem by breaking it up into a series of smaller, less complex programs. If you did not use the PIPE command, you might need several CMS or CP commands, or a program to solve the problem.
For example, to display a list of all the users that are logged on and the real address of the line to which each is connected, you can issue the CP QUERY NAMES command. The following is an example of the results of a CP QUERY NAMES command:
FURMAN - 1F83, PUTTEST - DSC , SHERMAN - 01C3, BERT -L0258
BARB - 1FEB, SHERRI - 0D7D, GROVER - 0DD1, DEVPVM - DSC
BATCHIT - DSC , OSCAR - DSC , SERVER3 - DSC , STONE - 1F62
SMITH - DSC , PIPER - 01CE, LOGN03BE - 03BE, PVM - DSC
TAMMIE - DSC , MACK - DSC , ERNIE - 0168, PETE - DSC
Now suppose you wanted a list, in single column format, of only the users that are currently connected and the real address of the line to which each is connected. You could either write a program to do this or use the PIPE command. The following exec, called CONNECT EXEC, uses a single PIPE command to display a list of the connected users:
/* Displays a list of connected users */
'pipe',
'cp q n',
'| split ,',
'| strip',
'| nlocate /- DSC/',
'| console'
exit rc
CONNECT EXEC displays the following:
FURMAN - 1F83
SHERMAN - 01C3
BERT -L0258
BARB - 1FEB
SHERRI - 0D7D
GROVER - 0DD1
STONE - 1F62
PIPER - 01CE
LOGN03BE - 03BE
ERNIE - 0168
For more information on the PIPE command, see z/VM: CMS Pipelines User's Guide and Reference.