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 COMMAND LIST PIPSTEMC */<br />

’PIPE (STAGESEP !) LITERAL %THIS IS MY MESSAGE% ’,<br />

’! DROP 1 ’,<br />

’! STEM C.’<br />

/* */<br />

SAY ’VALUE OF C.0 IS:’ C.0<br />

EXIT<br />

Output from PIPSTEMC follows:<br />

NCCF NETVIEW CNM01 OPER2 12/10/10 12:39:00<br />

* CNM01 PIPSTEMC<br />

C CNM01 VALUE OF C.0 IS: 0<br />

Processing steps:<br />

1. The LITERAL stage inserts the THIS IS MY MESSAGE message to the pipeline,<br />

passing it to the next stage.<br />

2. The DROP stage reads the message and discards it, leaving no messages in the<br />

pipeline.<br />

3. The STEM stage reads its input stream and, because it contains no messages,<br />

cannot create variables C.1 ... C.n. It sets the variable C.0 to zero to indicate that<br />

no messages were written.<br />

Reading from or Writing to a Command Procedure Message:<br />

SAFE<br />

The SAFE stage writes to or reads from a queue of pipeline messages which have<br />

complete message attributes and structure. Messages in a named SAFE can be<br />

processed by a different pipeline as long as the pipeline resides within the same<br />

<strong>NetView</strong> command list or the same family of nested <strong>NetView</strong> command lists.<br />

When the <strong>NetView</strong> command list family is exited, the storage occupied by the<br />

named SAFE is freed.<br />

Messages in an unnamed SAFE cannot be processed by a different <strong>NetView</strong><br />

command list. When the current <strong>NetView</strong> command list is exited, the storage<br />

occupied by the unnamed SAFE is freed.<br />

Example: Reading and Writing a Message Using SAFE<br />

<strong>NetView</strong> Pipelines Device Drivers<br />

This example shows how to use a REXX command list to process two PIPE<br />

commands using the SAFE stage. The first PIPE command writes messages to a<br />

named SAFE, while the second reads the messages from the same named SAFE,<br />

manipulates and displays them.<br />

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

/* THIS COMMAND LIST USES THE PIPE COMMAND AND THE SAFE STAGE */<br />

/****************************************************************/<br />

/* */<br />

/****************************************************************/<br />

/* PIPE # 1 */<br />

/* DISPLAY REMOTE DOMAIN INFORMATION AND STORE IN SAFE NAMED */<br />

/* HOLDMSG */<br />

/****************************************************************/<br />

’PIPE VTAM D NET,CDRMS’, /* issue command */<br />

’| CORRWAIT 10’, /* wait <strong>for</strong> messages */<br />

’| CONSOLE’, /* display to terminal */<br />

’| SAFE HOLDMSG’ /* save in SAFE msg queue */<br />

/****************************************************************/<br />

/****************************************************************/<br />

/* PIPE # 2 */<br />

Chapter 3. <strong>NetView</strong> Pipelines Device Drivers 299

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

Saved successfully!

Ooh no, something went wrong!