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.

********************************************************************<br />

* Write return code in<strong>for</strong>mation to console and exit command list **<br />

********************************************************************<br />

&WRITE RETURN CODE IS &RETCODE<br />

&EXIT<br />

Output from PIPEVAR command list follows:<br />

NCCF NETVIEW CNM01 OPER2 02/01/10 10:01<br />

* CNM01 PIPEVAR<br />

| CNM01 PA3 IS:<br />

| CNM01 DSI608I PA3 IMMED,IGNORE RETRIEVE AND EXECUTE<br />

C CNM01 RETURN CODE IS 0<br />

Processing steps <strong>for</strong> first pipeline:<br />

1. The NETVIEW stage issues the DISPFK command to display function key<br />

in<strong>for</strong>mation. The messages are not displayed, but are placed in the pipeline.<br />

2. The SEPARATE stage reads the messages, which are in the <strong>for</strong>m of an MLWTO,<br />

and it splits the MLWTO into single-line messages.<br />

3. The LOCATE stage selects any message (in this case, one) that contains the<br />

string PA3.<br />

4. The VAR stage writes the message to the variable named CLVAR1.<br />

Processing steps <strong>for</strong> second pipeline:<br />

1. The VAR stage reads the variable, CLVAR1, into the pipeline whereupon it<br />

becomes a message.<br />

2. The LITERAL stage inserts the PA3 IS: message in front of the message existing<br />

in the pipeline.<br />

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

Reading from or Writing to Variables in a Stemmed Array:<br />

STEM<br />

When used as a first stage, STEM reads stem variables from the command<br />

procedure variable pool. As anything other than the first stage, STEM writes<br />

single-line messages or lines of a MLWTO to stem variables. Stem variables are<br />

available to REXX, HLL, and <strong>NetView</strong> command list languages.<br />

Example 1: Writing to Variables Using STEM<br />

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

In this example, a REXX command list named PIPSTEMA shows how to use the<br />

STEM stage to write the output from a command to stem variables:<br />

/* REXX COMMAND LIST PIPSTEMA */<br />

’PIPE VTAM D NET,BFRUSE’, /* Run the D NET,BFRUSE cmd */<br />

’ | CORRWAIT 25’, /* Allow msgs time to return*/<br />

’ | T<strong>OS</strong>TRING LAST \END\’, /* Process until ’end’ msg */<br />

’ | STEM bfruse. ’ /* Put each line into a<br />

REXX array called bfruse */<br />

/* 0th element has the number<br />

of lines in the pipeline */<br />

/* Display variables */<br />

doi=0tobfruse.0<br />

say ’BFRUSE.’i ’is ’ bfruse.i<br />

end<br />

exit<br />

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

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

Saved successfully!

Ooh no, something went wrong!