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.

PIPE EDIT<br />

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

/START TASK=/ is an input order. A single number can be either an input or output<br />

order. Because /START TASK=/ is the input order, the number 1 following /START<br />

TASK=/ must be an output order. So, START TASK= is written to the first position<br />

of the output line.<br />

WORD 5 is also an input order. WORD requires a value, which in this case is 5.<br />

Because no global orders were specified <strong>for</strong> PARSE, parsing is done on blank<br />

delimited words. In the example line, the fifth blank delimited word, A01A441, is<br />

selected. The NEXT output order causes the selected word to be placed in the output<br />

line without an intervening blank.<br />

So, the resulting output of this edit script on the example message is:<br />

START TASK=A01A441<br />

If a NETVIEW stage follows the EDIT stage, this output is invoked as a command.<br />

Note: Because status lines reported from LIST have a slightly variable <strong>for</strong>mat, it<br />

might be better to find the target word by counting from the end of the line,<br />

using a negative value <strong>for</strong> WORD, or by counting from a fixed word in the<br />

text. See the descriptions of WORD and SKIPTO <strong>for</strong> more in<strong>for</strong>mation.<br />

Example: Sending an Alert to the <strong>NetView</strong> Alert Adapter<br />

The following example shows how to create a name/value pair. This name/value<br />

pair is bound with an automated alert and sent to the alert adapter. The command<br />

runs as a result of an automation statement containing TECROUTE.<br />

/* construct a value from MYVAR and a unique identifier */<br />

/* (GMT value set when alert received). Note: convert GMT to */<br />

/* displayable chars */<br />

’PIPE (NAME TECBIND)’,<br />

’| SAFE *’, /* copy complete automation alert into pipeline */<br />

’| EDIT’, /* begin edit */<br />

’COPY *’, /* copy complete automation alert to EDIT output*/<br />

’/’myvar’/’ 1, /* start value one: variable value */<br />

’IFRAUGMT C2X NEXTWORD’, /* add EBCDIC hex value */<br />

’NAMEBIND /EVENTID/’, /*create output line <strong>for</strong> TEC slot */<br />

’/’MSUSEG(’0000.31.30’,3)’/ 1’, /*start line with text vec */<br />

’NAMEBIND /ALERT31/’, /* create another TEC slot */<br />

’| PPI TECROUTE IHSATEC’ /* transfer event to TEC */<br />

/* Note use of virgule (/) to create a delimited string from the*/<br />

/* value of MSUSEG function assumes no virgule (and no stage sep*/<br />

/* character) exists in the text. In actual practice, it would */<br />

/* be wise to use non-printable characters <strong>for</strong> both delimiters. */

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

Saved successfully!

Ooh no, something went wrong!