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.

is searched. If you do not specify a position.length, the entire line is searched.<br />

For the with specifications as arguments <strong>for</strong>mat only, you can specify the letter S<br />

<strong>for</strong> the length if the specification is followed by a delimited string. When this<br />

is done, the CHANGE stage replaces the letter S with the length of that<br />

delimited string.<br />

R Specifies that the case of string1 is to be respected. This parameter is only valid<br />

<strong>for</strong> the with parameters from secondary input <strong>for</strong>mat, and is the default. For the<br />

with specifications as arguments <strong>for</strong>mat, case is respected.<br />

I Specifies that the case of string1 is to be ignored. This parameter is only valid<br />

<strong>for</strong> the with parameters from secondary input <strong>for</strong>mat. For the with specifications as<br />

arguments <strong>for</strong>mat, specify the CHANGE stage on the CASEI stage.<br />

string1<br />

The character string to be replaced in input lines.<br />

string2<br />

The character string to replace string1.<br />

Usage Notes<br />

The CHANGE stage cannot be a first stage.<br />

Examples<br />

Example: Changing All Occurrences of a String<br />

The following example changes all occurrences of 'AAA' to 'ZZ'.<br />

PIPE LITERAL /AAABBBAAA/<br />

| CHANGE /AAA/ZZ/<br />

| CONSOLE<br />

The following output is produced:<br />

ZZBBBZZ<br />

Example: Inserting Constants<br />

The following example inserts a constant at the start of each line.<br />

PIPE NETV DISCONID<br />

| CHANGE //DISCONID: /<br />

| CONSOLE<br />

Output similar to the following output is produced:<br />

DISCONID: CNM492I OPERATOR ID CONSOLE ID CONSOLE NAME<br />

DISCONID: CNM492I ----------- ---------- ------------<br />

DISCONID: CNM492I NTVF0PPT EXTENDED NTVFTF0<br />

DISCONID: CNM492I AUTOAON EXTENDED AUTONF0<br />

DISCONID: CNM492I END DISPLAY<br />

Example: Using CHANGE with CASEI Stage<br />

Starting from column 2, the following example changes up to 4 occurrences of 'A'<br />

or 'a' to 'Zz'.<br />

NETVASIS PIPE LITERAL /AaBbAaCcAa/<br />

| CASEI CHANGE 2.* /a/Zz/ 4<br />

| CONSOLE<br />

The following output is produced:<br />

AZzBbZzZzCcZza<br />

PIPE CHANGE<br />

Chapter 2. Pipeline Stages and Syntax 35

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

Saved successfully!

Ooh no, something went wrong!