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 />

PIPE LOOKUP<br />

v Having any character other than an asterisk (*) as the second character, and<br />

v Having the third and fourth characters CD.<br />

Note: Z can be used to check a detail record that represents a wildcard<br />

pattern. The intended use is to enable security checking of wildcard<br />

patterns.<br />

If a blank is specified <strong>for</strong> any of the three characters, x, y, orz, indicates to not<br />

use that option to select matching records.<br />

v LOOKUP requires two input streams and supports up to three output streams. If<br />

an output stream is not connected, the data to be passed on that output stream<br />

is discarded.<br />

v LOOKUP must be able to read its secondary input until it disconnects. If it<br />

cannot read its secondary input, the pipeline can clog.<br />

For in<strong>for</strong>mation about clogged pipelines, see “Clogged Pipelines” on page 346.<br />

v When the length <strong>for</strong> the detail and reference records are different, and the<br />

WILDCARD option is not used, the characters specified <strong>for</strong> the reference record<br />

are searched <strong>for</strong> within the characters specified in the detail record. For example,<br />

if LOOKUP 1.6 5.2 is specified, two characters of each reference record<br />

beginning at character 5 are compared to the first 6 characters in the detail<br />

record. Two consecutive characters within the first 6 characters of the detail<br />

record matching the 2 characters specified in the reference records cause a<br />

match. However, LOOKUP 1.2 6.4 searches <strong>for</strong> 4 characters of each reference<br />

record in 2 characters of the detail record.<br />

When the WILDCARD option is used, the pattern specified by the reference<br />

record is compared to the data in the detail records. For a match to occur, the<br />

data must match the pattern. All characters in the referenced data field are<br />

significant, including blanks. A wildcard pattern with trailing blanks implies that<br />

the detail record must have blanks in the same position. The pattern "AB*" is not<br />

the same as "AB* ".<br />

v Reference record line attributes such as color and line count are preserved.<br />

However, message attributes such as MLWTO structure and AUTOTOKE are not<br />

preserved.<br />

v When APPEND is specified, LOOKUP appends both the data and line attributes<br />

of the reference record to the detail record.<br />

When the line attributes become inappropriately mixed within the output data<br />

stream, <strong>for</strong> example a label coming after a data line, insert a COLLECT MAX 1<br />

stage be<strong>for</strong>e writing the output data stream to the CONSOLE.<br />

v Detail record line and message attributes are preserved in the output stream.<br />

v Avoid duplicate reference records. LOOKUP processing cannot guarantee which<br />

of the duplicate records is to be examined. Duplicate reference records must be<br />

particularly avoided if the APPEND keyword is specified, because the record<br />

selected by LOOKUP to be appended is unknown.<br />

v Reference records passed to the third output stream might not be in the same<br />

order as received on the secondary input stream.<br />

Example: Comparing Values Contained in Two Stems<br />

The following REXX fragment compares the stem old. to new. and creates three<br />

new stems:<br />

Chapter 2. Pipeline Stages and Syntax 161

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

Saved successfully!

Ooh no, something went wrong!