28.11.2012 Views

IBM Tivoli NetView for z/OS Programming: Pipes - IBM notice

IBM Tivoli NetView for z/OS Programming: Pipes - IBM notice

IBM Tivoli NetView for z/OS Programming: Pipes - IBM notice

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Complex Pipelines<br />

Chapter 2, “Pipeline Stages and Syntax,” on page 19 describes each <strong>NetView</strong><br />

pipeline stage.<br />

Some stages accept multiple input streams and others generate multiple output<br />

streams.<br />

An example of a stage that generates multiple output streams is the LOCATE stage<br />

as shown in Figure 3 on page 3 and Figure 6 on page 4.<br />

LOCATE is used to select specific data from the input stream. In both examples,<br />

only the input data, including the string BOB, flow through the stage. But, what if<br />

you wanted a way to act on both the selected data and the data that was not<br />

selected? You really want a pipeline that looks something like that shown in<br />

Figure 9.<br />

Bob Smith<br />

Fred Ford<br />

Mary Bobbit<br />

Figure 9. Complex Pipeline<br />

Locate /Bob/<br />

Stage<br />

Bob Smith<br />

Mary Bobbit<br />

Fred Ford<br />

Introduction and Concepts<br />

Output selected<br />

by Locate<br />

Output not selected<br />

by Locate<br />

The pipeline shown in Figure 9 is called a complex pipeline. A complex pipeline is<br />

made up of simple pipelines connected with labels, such as the one shown in<br />

Figure 6 on page 4. Complex pipelines are simple programs rather than<br />

complicated commands.<br />

Creating a Complex Pipeline<br />

This section describes the way to create a complex pipeline using stages with<br />

multiple inputs and outputs. When stages are adjacent to each other in a pipeline,<br />

the output stream of a stage is connected to the input stream of the stage that<br />

follows.<br />

Use a label to connect the streams of stages that are not adjacent. A label is 1–8<br />

alphanumeric characters followed by a colon. For example, the B in the following<br />

example is a label:<br />

...|B: LOCATE /X/|...<br />

To use multiple streams, first include the label on the stage that results in multiple<br />

output streams. This first label defines or declares the label. Then, place a matching<br />

label in the pipeline specification as if it were a stage. The stages following the<br />

label will act on the data passed as the primary output of the stage defining the<br />

label. The label acts as a connector and provides the input stream to the<br />

subsequent pipeline stages, <strong>for</strong> example:<br />

Chapter 1. <strong>NetView</strong> Pipelines Introduction and General Concepts 7

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!