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.

PIPE CHOP<br />

/string/<br />

A character string enclosed in delimiters.<br />

width<br />

The default column. For <strong>OS</strong>T tasks, the screen width is used. For automation<br />

tasks and other tasks, zero is used.<br />

Usage Notes<br />

CHOP cannot be the first stage.<br />

Examples<br />

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

Example: Truncating Lines<br />

The following example truncates all lines after column 44.<br />

PIPE NETV QRYGLOBL COMMON VARS=*<br />

| SEPARATE<br />

| LOCATE /BNH039/<br />

| CHOP 44<br />

| CONS ONLY<br />

---> BNH039I SMFVPD<br />

---> BNH039I CGAUTHID2<br />

---> BNH039I LONGONE<br />

...<br />

Example: Truncating Text<br />

The following example truncates all text from the character be<strong>for</strong>e the first number.<br />

PIPE LITERAL /GOOD STUFF 00001204/<br />

| CHOP 1 BEFORE ANYOF /1234567890/<br />

| CONSOLE<br />

---> GOOD STUFF<br />

Example: Isolating Text Within a Line<br />

Coded as a REXX example:<br />

'PIPE NETV necessary command ',<br />

' | SEPARATE',<br />

' | LOCATE 1.7 /IST486I/',<br />

' | CONSOLE',<br />

' | NOT CHOP AFTER STRING /STATUS= /',<br />

' | CHOP BEFORE STRING /,/',<br />

' | VAR state'<br />

SAY 'The value of state is ' state<br />

---> IST486I STATUS= ACTIV , DESIRED STATE= ACTIV<br />

---> The value of state is ACTIV

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

Saved successfully!

Ooh no, something went wrong!