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 INTERPRT<br />

Usage Notes<br />

Examples<br />

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

v INTERPRT can be used anywhere in the pipeline specification.<br />

v Do not include an INTERPRT stage among the stages being inserted by the<br />

INTERPRT stage.<br />

v All stages are assigned numbers based on their position in the pipeline<br />

specification. These numbers are shown in some error messages. Stage names<br />

inserted by the INTERPRT stage are assigned numbers according to the<br />

following <strong>for</strong>mula:<br />

(pn) + ((10000)(sn))<br />

Where:<br />

pn Specifies the positions of the stages in the pipeline specification.<br />

sn Specifies the stage number of the INTERPRT stage in the pipeline<br />

specification.<br />

Example: Building Large Pipeline Specifications<br />

Assume that the following variables are defined as input to the STEM stage of the<br />

pipeline specification below. OPER_CMD is a command of unknown size. Using<br />

the INTERPRT stage provides <strong>for</strong> the possibility that OPER_CMD can cause the<br />

pipeline specification to exceed the 240-character limit.<br />

/* SAMPLE REXX COMMAND LIST */<br />

X.0=5<br />

X.1 = ’NETVIEW’ OPER_CMD<br />

X.2 = ’SEPARATE’<br />

X.3 = ’TAKE 10’<br />

X.4 = ’COLLECT’<br />

X.5 = ’CONSOLE’<br />

/* */<br />

/* Collect the data records from the STEM X stage */<br />

/* (X is the name of the variables), and drive */<br />

/* the INTERPRT stage. */<br />

/* */<br />

’PIPE (NAME OUTER) STEM X.’,<br />

’| COLLECT’,<br />

’| NETVIEW PIPE (NAME INNER) INTERPRT *’,<br />

’| CONSOLE’<br />

EXIT<br />

During processing of the preceding command, the data records from the STEM<br />

stage are <strong>for</strong>med into a multiline message. The NETVIEW stage uses the pipeline<br />

message it receives to drive the INTERPRT stage. The INTERPRT stage interprets<br />

each of the data records in the message as a complete stage specification, then<br />

builds stages from the input data <strong>for</strong> the command. All such stages are substituted<br />

into the pipeline specification in place of the INTERPRT stage.<br />

An equivalent pipeline created without using the INTERPRT stage is shown below.<br />

This pipeline is simpler but fails if the size of OPER_CMD <strong>for</strong>ces the entire<br />

specification to become too large.<br />

/* SAMPLE REXX COMMAND LIST */<br />

’PIPE NETVIEW’ OPER_CMD,<br />

’| SEPARATE’,<br />

’| TAKE 10’,<br />

’| COLLECT’,<br />

’| CONSOLE’<br />

EXIT

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

Saved successfully!

Ooh no, something went wrong!