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.

The simple pipeline FAN:FANIN|LABS: passes the data to COLLECT in the order<br />

the streams were defined. This allows color or other processing to be done on the<br />

message prior to the COLLECT stage.<br />

By adding DEBUG you see the connection flow within the pipeline.<br />

/* REXX Example */<br />

address NETVASIS,<br />

’PIPE (NAME TASKLIST END \)’,<br />

’| NETV LIST STATUS=TASKS’, /* generate the data */<br />

’| DROP LAST 1’, /* no need of "END OF DATA" */<br />

’| COLOR GREEN’, /* standardize buffers */<br />

’| EDIT WORD 2 1’, /* re<strong>for</strong>mat data from the lines */<br />

’19.8 8’,<br />

’38.8 19’,<br />

’55.* 35’,<br />

’| LABS: COLLECT’, /* data and labels, labels first */<br />

’| CONSOLE ONLY’, /* display results */<br />

, /* --- END of simple pipeline, begin new pipeline..*/<br />

’\ FAN: FANIN’, /* feed data to "LABS", in order */<br />

’| LABS:’,<br />

, /* --- END of simple pipeline, begin new pipeline..*/<br />

’\ LIT !-------- Status of <strong>NetView</strong> Tasks ---------!’,<br />

’| COLOR YEL’, /* Control line becomes yellow */<br />

’| FAN:’, /* give to "FAN" (primary input) */<br />

" LIT !Task Task’s Taskname or Current!",<br />

’| COLOR PINK’, /* First label line becomes pink */<br />

’| FAN:’, /* give line to "FAN" (2nd input)*/<br />

"\ LIT !type D Resource Status!",<br />

’| COLOR PINK’, /* Second label line becomes pink. */<br />

’| FAN:’ /* give line to "FAN" (3rd input) */<br />

Example: Formatting MVS D A,L Output<br />

In the following example, each new output line contains in<strong>for</strong>mation about only<br />

one job. The original three label lines are still label lines.<br />

The source <strong>for</strong> this example is in CNMS1101.<br />

/* REXX Example */<br />

’PIPE (NAME DISPAL END \)’,<br />

’| CORRCMD MVS D A,L’, /* generate data */<br />

’| SEPARATE’, /* handle lines individually */<br />

,/* SEP preserves the line type (ctl, label, data, end) */<br />

’|A: TAKE 3’, /* first 3 to primary, rest 2ndary */<br />

’| COLOR WHITE’, /* Ctl & label become white */<br />

’|Z: FANINANY’, /* all lines return here... */<br />

’| COLLECT’, /* collect all lines, preserve type*/<br />

’| CONSOLE ONLY’,<br />

’\ A:’, /* data lines come here... */<br />

’|C: CHOP 35’, /* left side to primary, rest "C" */<br />

, /* CHOP also preserves the line type */<br />

’| COLOR BLUE’, /* some data becomes blue */<br />

’|Z:’, /* give in back to FANINANY */<br />

’\C:’, /* right side of data comes here */<br />

’| COLOR TUR’, /* other data becomes turquoise */<br />

’|Z:’ /* give in back to FANINANY */<br />

PIPE COLLECT<br />

Chapter 2. Pipeline Stages and Syntax 43

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

Saved successfully!

Ooh no, something went wrong!