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.

PIPE JOINCONT<br />

Usage Notes<br />

Examples<br />

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

If multiple search strings are valid matches to the message, the longest<br />

matching string is replaced by the substitution string.<br />

A line is considered a match, if any of the comparison strings are found in the<br />

appropriate leading or trailing position. A null string (//) is always a match.<br />

At least one delimited string must be specified. You can specify /string/ up to<br />

40 times.<br />

The first nonblank character encountered after the keywords is the delimiter<br />

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

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

TRAILING<br />

Specifies that if there is a match to the comparison string at the end of the<br />

message, the next message is appended to the message that contained the<br />

match. The default is TRAILING.<br />

v JOINCONT cannot be the first stage.<br />

v JOINCONT is used only with single-line messages. If the function is needed <strong>for</strong><br />

multiline messages, use a SEPARATE stage preceding the JOINCONT stage.<br />

v Processing a JOINCONT stage on messages, which are all multiline or a<br />

combination of single line and multiline, yields unpredictable results.<br />

Example: Joining Messages Ending in a '$'<br />

For this example, you have established a file member named MYFILE in which<br />

some of the lines end with the character '$'. The file contains the following 80-byte<br />

records:<br />

YES<br />

PIPE$<br />

LINES $<br />

ARE $<br />

GREAT<br />

Enter this command to eliminate each record's trailing blanks, leave the YES<br />

message, join those that end in '$' into a new message 'PIPELINES ARE GREAT',<br />

and write the results to the console:<br />

PIPE < MYFILE<br />

| STRIP TRAILING / /<br />

| JOINCONT TRAILING /$/<br />

| CONSOLE<br />

Response<br />

YES<br />

PIPELINES ARE GREAT<br />

Example: Joining Messages and Substituting a Character<br />

Suppose you have established a file member named LETTERS in which you have<br />

some random vowels and consonants. The file contains the following 80-byte<br />

records:<br />

A VOWEL<br />

E VOWEL<br />

I VOWEL<br />

O VOWEL<br />

U

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

Saved successfully!

Ooh no, something went wrong!