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.

* REXX sample command list */<br />

’PIPE LITERAL //’,<br />

’| SAFE ABC’<br />

The SAFE named ABC exists and contains one message. The message in the SAFE<br />

has no associated message text.<br />

Example: Passing Messages to a Second PIPE Command<br />

The following example shows how a PIPE command can pass messages to a<br />

second PIPE command using the default SAFE.<br />

PIPE LITERAL /Message created by outer PIPE/<br />

| NETVIEW PIPE (STAGESEP %) SAFE *<br />

% LITERAL /Message created by inner pipe/<br />

% COLLECT<br />

% CONSOLE<br />

| CONSOLE ONLY<br />

The outer pipe generates a message and invokes the inner pipe. The inner pipe<br />

reads the outer pipe's message, adds another message to it, COLLECTs both<br />

messages into a multiline message and sends it to the outer pipe. The outer pipe<br />

displays the multiline message with the CONSOLE ONLY stage.<br />

Example: Passing Messages to a REXX command list<br />

Issue a PIPE command, which invokes a REXX command. The REXX command<br />

reads its default SAFE into the pipeline and displays it to the console.<br />

PIPE LITERAL /Message created by PIPE/<br />

| NETVIEW SHOWDFLT<br />

| CONSOLE ONLY<br />

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

’PIPE SAFE *’,<br />

’| LITERAL /Message created by SHOWDFLT/’,<br />

’| COLLECT’,<br />

’| CONSOLE’<br />

In this example the PIPE command creates a message and calls the SHOWDFLT<br />

command list. The SHOWDFLT command list reads the current message (passed<br />

by invoking PIPE) into its pipeline. A second message is added and a multiline<br />

message is created. The CONSOLE stage within the SHOWDFLT command list<br />

passes the multiline message to the CONSOLE ONLY stage of the invoking PIPE<br />

and the message is displayed.<br />

Example: Using a Named SAFE as a Message Queue<br />

A named SAFE (THISSAFE) is used as a message queue <strong>for</strong> command procedures<br />

in a command procedure group. To begin, invoke the following SAFEEX1<br />

command list:<br />

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

’PIPE LITERAL /Added by SAFEEX1/’,<br />

’| SAFE THISSAFE’<br />

’SAFEEX2’<br />

’PIPE SAFE THISSAFE’,<br />

’| COLLECT’,<br />

’| CONSOLE CLEAR’<br />

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

’PIPE LITERAL /Added by SAFEEX2/’,<br />

’| SAFE THISSAFE APPEND’<br />

’SAFEEX3’<br />

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

’PIPE LITERAL /Added by SAFEEX3/’,<br />

’| SAFE THISSAFE APPEND’<br />

PIPE SAFE<br />

Chapter 2. Pipeline Stages and Syntax 209

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

Saved successfully!

Ooh no, something went wrong!