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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Introduction and Concepts<br />

The LOCATE stage is a filter. LOCATE examines the messages from its input<br />

stream, and searches <strong>for</strong> those containing a specified string. The messages that<br />

match are written to the output stream; those that do not match are discarded or<br />

passed to a secondary output stream, if one is connected.<br />

Filters per<strong>for</strong>m many functions of general use. For example, they select messages<br />

based on the content of the message or on the position of the message in the<br />

stream flowing through the pipeline.<br />

Understanding <strong>NetView</strong> Pipelines<br />

12 <strong>Programming</strong>: <strong>Pipes</strong><br />

When you issue the PIPE command, <strong>NetView</strong> pipelines check the spelling and<br />

syntax of all the stage specifications. If spelling and syntax are correct, pipeline<br />

processing begins. Otherwise, the pipeline is stopped and a nonzero return code is<br />

generated.<br />

How a Pipeline Begins<br />

After processing begins, the PIPE command decides which stage to run and when<br />

to run it. It is not a matter of turning on all stages at once or of turning on one<br />

stage and running it to completion be<strong>for</strong>e starting the next stage. For the most<br />

part, the processing resembles the plumbing pipeline described earlier. That is:<br />

v Data begins flowing from a source through a device driver. At this point, no<br />

subsequent stages are active.<br />

v The device driver passes the data to the next stage, a filter, perhaps. The driver<br />

then gets more data. At this point only the driver and the filter are active.<br />

v Data flows from stage to stage, activating each stage as it goes.<br />

v Soon, the entire pipeline is active with a flow of data just as a plumbing pipeline<br />

is active with a flow of water.<br />

v Ultimately, data begins to leave the pipeline through a device driver and the<br />

source of data will be exhausted.<br />

v As the last bits of data flow through the pipeline, stages disconnect from their<br />

input and output streams as they become inactive.<br />

v After all the stages have disconnected, the pipeline ends.<br />

By operating in this fashion, a pipeline can process an extremely large volume of<br />

data without having to keep the entire volume in storage. However, some stages<br />

need to read all the data be<strong>for</strong>e they can begin processing messages. For example,<br />

the COLLECT command must collect all the messages from the input stream<br />

be<strong>for</strong>e writing the messages as one multiline write-to-operator message (MLWTO)<br />

to its output stream.<br />

How a Pipeline Ends<br />

Each stage uses its own rules to determine when (and whether) to disconnect. For<br />

many stages, a disconnect from one side causes the stage to disconnect from the<br />

other side. Some stages (T<strong>OS</strong>TRING, <strong>for</strong> example) examine the message stream to<br />

determine when to disconnect the output stream.<br />

Usually, a pipeline continues to process as long as any stages are connected.<br />

A pipeline ends when all of its stages end. A stage ends when one of the following<br />

events occurs:<br />

v The stage completes its function.<br />

v The stage detects an unrecoverable error.

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

Saved successfully!

Ooh no, something went wrong!