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.

Usage Notes<br />

Examples<br />

is searched. You can specify the letter S <strong>for</strong> the length if the specification is<br />

followed by a delimited string. The T<strong>OS</strong>TRING stage replaces the letter with<br />

the length of that delimited string.<br />

/string/<br />

Specifies a string <strong>for</strong> which to search. A message is considered a match if any<br />

of the specified strings are found within it. The first nonblank character<br />

encountered after the stage name or position.length is the delimiter which<br />

establishes the boundary of the text string used by the stage. The delimited<br />

string ends when the same character is encountered a second time.<br />

BLANK<br />

Specifies that the character string <strong>for</strong> which to search contains only blanks. The<br />

search occurs in the range specified by the position.length parameter, but if the<br />

data contains only blanks, a match is recognized regardless of the length<br />

specified.<br />

NULL<br />

Specifies that the stage is to search <strong>for</strong> no data whatsoever, that is, null data<br />

(not even blanks). This means that a match is recognized only when the data is<br />

shorter than the number specified <strong>for</strong> position in the position.length parameter.<br />

v T<strong>OS</strong>TRING cannot be the first stage.<br />

v If the delimited string is longer than the length specified on the T<strong>OS</strong>TRING<br />

stage, no matches occur and all messages are discarded from the pipeline.<br />

v T<strong>OS</strong>TRING is a terminating stage, meaning that when a match is found,<br />

processing <strong>for</strong> this stage ends along with any outstanding CORRWAIT.<br />

v You can specify the position.length and /string/ pair up to 40 times.<br />

Example: Using T<strong>OS</strong>TRING to End a Wait<br />

Because VTAM commands do not return an end of response indication, the text of<br />

the response must be examined instead. In this REXX example, T<strong>OS</strong>TRING<br />

terminates after it has processed the message containing the string /IST314I/. This<br />

termination disconnects the output stream of CORRWAIT and causes the wait to<br />

end.<br />

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

’| VTAM D NET,LINES’, /* Issue VTAM display command */<br />

’| CORRWAIT 50’, /* Wait up to 50 seconds <strong>for</strong> response*/<br />

’| T<strong>OS</strong>TRING /IST314I/’ /* Last line expected: IST314I END */<br />

’| SEPARATE’, /* (<strong>for</strong> example) */<br />

’ ... ’, /* processing as required. */<br />

PIPE T<strong>OS</strong>TRING<br />

The following stage, in this case SEPARATE, does not have a disconnected input<br />

stream until after it consumes the last message. The remainder of the pipeline can<br />

process the message containing /IST314I/ be<strong>for</strong>e it ends.<br />

Chapter 2. Pipeline Stages and Syntax 237

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

Saved successfully!

Ooh no, something went wrong!