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.

Notice that the vertical bar (|) has replaced the first characters of each line,<br />

indicating that the message is no longer held. When the user presses ENTER<br />

the message disappears.<br />

Example 3: Multiple CONSOLE Stages<br />

This example shows how the insertion of multiple CONSOLE stages into the<br />

pipeline affects output. It illustrates how the CONSOLE stages handle their input<br />

streams, processing messages as they receive them. If single-line messages are<br />

processed by multiple CONSOLE stages there is no way to predict in what order<br />

the messages by one CONSOLE stage interfaces with messages written by other<br />

CONSOLE stages. Study this example in conjunction with Example 4, which<br />

demonstrates how adding the COLLECT stage to gather the pipeline messages into<br />

a multiline message prior to a CONSOLE stage modifies the screen output.<br />

This example shows how the insertion of the CONSOLE stage between other<br />

stages affects output from the pipeline.<br />

PIPE LITERAL ? This is the CCC message ?<br />

| CONSOLE<br />

| LITERAL / This is the BBB message /<br />

| CONSOLE<br />

| LITERAL ! This is the AAA message !<br />

| CONSOLE<br />

Output from the pipeline looks like this:<br />

<strong>NetView</strong> Pipelines Device Drivers<br />

NCCF NETVIEW CNM01 OPER5 02/01/10 10:40:10<br />

* CNM01 PIPE LITERAL ? THIS IS THE CCC MESSAGE ? | CONSOLE | LITERAL / THIS<br />

IS THE BBB MESSAGE / | CONSOLE | LITERAL ! THIS IS THE AAA MESSAGE<br />

! | CONSOLE<br />

| CNM01 THIS IS THE CCC MESSAGE (written by console stage # 1)<br />

| CNM01 THIS IS THE BBB MESSAGE (written by console stage # 2)<br />

| CNM01 THIS IS THE AAA MESSAGE (written by console stage # 3)<br />

| CNM01 THIS IS THE CCC MESSAGE (written by console stage # 2)<br />

| CNM01 THIS IS THE BBB MESSAGE (written by console stage # 3)<br />

| CNM01 THIS IS THE CCC MESSAGE (written by console stage # 3)<br />

Processing steps:<br />

1. The first LITERAL stage writes the CCC message to the pipeline.<br />

2. The first CONSOLE stage reads the CCC message and displays it on the screen.<br />

The message remains in the pipeline.<br />

3. The second LITERAL stage writes the BBB message to the output stream in<br />

front of the CCC message in the stream.<br />

4. The second CONSOLE stage reads the BBB message in its input stream and<br />

writes it on the screen. The message also remains in the pipeline.<br />

5. The third LITERAL stage writes the AAA message to the output stream in front<br />

of the BBB and CCC messages in the stream.<br />

6. The third CONSOLE stage reads the AAA message and writes it on the screen. It<br />

also remains in the pipeline, although there are no additional stages to process<br />

it.<br />

7. The second CONSOLE stage reads the CCC message in its input stream and<br />

writes it on the screen. The message also remains in the pipeline.<br />

8. The third CONSOLE stage reads the BBB message in its input stream and writes<br />

it on the screen. The message also remains in the pipeline, although there are<br />

no additional stages to process it.<br />

Chapter 3. <strong>NetView</strong> Pipelines Device Drivers 285

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

Saved successfully!

Ooh no, something went wrong!