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.

<strong>NetView</strong> Pipeline Filters<br />

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

2. The NLOCATE stage reads the messages and examines them <strong>for</strong> the NOT ACTIVE<br />

string in columns 55 - 64. If that string is found, the message is discarded. All<br />

other messages are written to the output stream.<br />

3. The CONSOLE stage reads the messages and displays them.<br />

Note: If the example were changed to add an additional selection criteria to the<br />

NLOCATE stage, searching <strong>for</strong> OPT in columns 7-9,theresults from the<br />

pipeline are similar to.<br />

NCCF NETVIEW CNM01 OPER6 05/17/10 13:38:43<br />

* CNM01 PIPE NETVIEW LIST STATUS=TASKS | NLOCATE 55.10 /NOT ACTIVE/ 7.3<br />

/OPT/ | CONSOLE<br />

- CNM01 TYPE: MNT TASKID: MNT RESOURCE: CNM01 STATUS: ACTIVE<br />

- CNM01 TYPE: PPT TASKID: CNM01PPT RESOURCE: CNM01PPT STATUS: ACTIVE<br />

- CNM01 TYPE: <strong>OS</strong>T TASKID: OPER6 RESOURCE: A01A702 STATUS: ACTIVE<br />

- CNM01 TYPE: <strong>OS</strong>T TASKID: AUTO1 RESOURCE: AUTO1 STATUS: ACTIVE<br />

- CNM01 TYPE: <strong>OS</strong>T TASKID: AUTO2 RESOURCE: AUTO2 STATUS: ACTIVE<br />

- CNM01 TYPE: <strong>OS</strong>T TASKID: DSILCOPR RESOURCE: DSILCOPR STATUS: ACTIVE<br />

- CNM01 END OF STATUS DISPLAY<br />

Example 4: Using NLOCATE to Process an MLWTO<br />

This example shows how to use the NLOCATE stage to discard an MLWTO that<br />

contains a specified text string:<br />

PIPE NETVIEW LIST DEFAULTS | NLOCATE /LOG/ | CONSOLE<br />

Output from the pipeline is similar to:<br />

NCCF NETVIEW CNM01 OPER6 02/01/10 10:11:15<br />

* CNM01 PIPE NETVIEW LIST DEFAULTS | NLOCATE /LOG/ | CONSOLE<br />

Processing Steps:<br />

1. The NETVIEW stage executes the LIST command and writes the results to the<br />

output stream as an MLWTO.<br />

2. The NLOCATE stage reads its input stream, examines the messages <strong>for</strong> the LOG<br />

text string and because LOG occurs at least once in the MLWTO, the entire<br />

MLWTO is discarded.<br />

3. Because there are no messages in its input stream, the CONSOLE stage ends<br />

without displaying anything. Only the command echo is seen.<br />

Note: If the example is changed to insert the SEPARATE stage prior to the<br />

NLOCATE stage, the pipeline results change. The SEPARATE stage breaks<br />

the output of the LIST command, an MLWTO, into single-line messages.<br />

NLOCATE reads its input stream, and examines each single-line message<br />

(instead of the entire MLWTO) <strong>for</strong> the occurrence of LOG, discarding matches<br />

as appropriate.<br />

PIPE NETVIEW LIST DEFAULTS | SEPARATE | NLOCATE /LOG/ | CONSOLE<br />

Output (first page) from the pipeline looks similar to:

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

Saved successfully!

Ooh no, something went wrong!