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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Examples<br />

BEFORE<br />

The line is split just be<strong>for</strong>e the specified string or character. Nothing is deleted<br />

from the output. The point at which the split occurs can be adjusted using<br />

charcnt.<br />

See also the AFTER keyword.<br />

charcnt<br />

Indicates an offset to the split point. For example, if /string/ is specified, the<br />

value of /string/ is found first, then the split is made charcnt characters be<strong>for</strong>e<br />

or after that point. The value of charcnt must be a positive number, negative<br />

number, or zero (0). The default value is zero (0).<br />

Valid values <strong>for</strong> charcnt are in the range of −10,000,000 - +10,000,000.<br />

See also the BEFORE and AFTER keywords.<br />

STRING<br />

Indicates that the /string/ is a single string. A match occurs only when the<br />

complete string is found.<br />

See also the ANYOF keyword.<br />

/string/<br />

A delimited character string containing a character list or string. SPLIT<br />

searches <strong>for</strong> /string/ as indicated by the ANYOF or STRING keyword and split<br />

the input line at each occurrence. The default value <strong>for</strong> /string/ is a single<br />

blank.<br />

Note: One or more characters must be enclosed within the delimiters. /String/<br />

cannot be a null string (//).<br />

Example: Splitting at Blanks<br />

The following splits the literal string /HERE IS SOMETHING TO SPLIT/ at each<br />

blank:<br />

PIPE LITERAL /HERE IS SOMETHING TO SPLIT./<br />

| SPLIT<br />

| CONSOLE<br />

The output displayed on the console is:<br />

HERE<br />

IS<br />

SOMETHING<br />

TO<br />

SPLIT.<br />

Example: Splitting Following a String<br />

The following splits the literal string /BUY IT, YOU'LL SPLIT AND LIKE IT<br />

BETTER./ three characters after each occurrence of the string /IT/:<br />

PIPE LITERAL /BUY IT, YOU’LL SPLIT AND LIKE IT BETTER./<br />

| SPLIT 3 AFTER STRING /IT/<br />

| CONSOLE<br />

The output displayed on the console is:<br />

BUY IT, Y<br />

OU’LL SPLIT AN<br />

D LIKE IT BE<br />

TTER.<br />

PIPE SPLIT<br />

Chapter 2. Pipeline Stages and Syntax 217

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

Saved successfully!

Ooh no, something went wrong!