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.

Examples<br />

('1' B). PPI (TRAPROUT) is not valid <strong>for</strong> a generic alert whose<br />

subvector X'92' flag bit 4 is on. For more in<strong>for</strong>mation, refer to the<br />

SNA library.<br />

1005 The specified target type does not support the data. For example,<br />

(TRAPROUT) was specified <strong>for</strong> a message which is not an alert.<br />

1012 The user is not authorized.<br />

Other Any valid return code returned by a PPI request type 4 (init), 14<br />

(send), or 22 (receive). See the <strong>IBM</strong> <strong>Tivoli</strong> <strong>NetView</strong> <strong>for</strong><br />

z/<strong>OS</strong> Application Programmer's Guide <strong>for</strong> in<strong>for</strong>mation about these<br />

return codes.<br />

Example: Generating an Alert from Hex Data<br />

The following REXX example produces an alert similar to the following example<br />

on the NPDA ALD screen:<br />

NTV7E GENAL3 COMC 13:43 EQUIPMENT<br />

MALFUNCTION:COMM SUBSYST CTRL<br />

The text 'Here is my subvector 31 stuff.' is seen by selecting the alert and entering<br />

"D" to view the event detail.<br />

Note: Vector lengths in alerts must be correct or the alert might not be recognized.<br />

/*** Make an alert ********/<br />

altxt = ’41038D000000000000780000’X<br />

altxt = altxt||’0B92000001100012345678’X<br />

altxt = altxt||’1010000D110E0A0040F2F3F4F5F6F7F8’X<br />

altxt = altxt||’069304032012’X<br />

altxt = altxt||’0E950601150213E1068101011504’X<br />

altxt = altxt||’1103030109C7C5D5C1D3F34040C3D6D4C3’X<br />

altxt = altxt||’04931001’X<br />

altxt = altxt||’30310602046E01F40512’X||’ENU’||’032111’X<br />

altxt = altxt||’2030’X||’Here is my subvector 31 stuff.’<br />

’pipe (end =) var altxt’,<br />

’| a: PPI *ALERT’,<br />

’|cons dump’,<br />

’= a:’,<br />

’|color whi’,<br />

’|cons’<br />

PIPE PPI<br />

Example: Responding to Requests<br />

The following simple example responds to the COUNT request with the number of<br />

requests processed so far. Other requests receive the response ERROR 1.<br />

Note: The receiver is not shut down when the pipeline ends so the response can<br />

be generated.<br />

/*** responding to a request ********/<br />

’PIPE (NAME CNMCOUNT END ¬)’,<br />

’| PPI CNMCOUNT’, /* receive <strong>for</strong> receiver name "CNMCOUNT" */<br />

’| WAIT *’, /* CORRWAIT (until RESET or STOP FORCE) */<br />

’| COUNT EACHLINE’, /* using line count <strong>for</strong> requested data */<br />

’| X: LOC 1.5 /COUNT/’, /* valid requests... */<br />

’| EDIT LINECOUNT 1’, /* constructing the simple response */<br />

’| PPI *’, /* sending the response to requestor */<br />

, /* -------------------- end of pipeline 1 ---------- */<br />

’¬ X:’, /* invalid requests come here. */<br />

’| EDIT /ERROR 1/ 1’, /* error message... */<br />

’| PPI *’ /* sending error message to requestor */<br />

Chapter 2. Pipeline Stages and Syntax 191

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

Saved successfully!

Ooh no, something went wrong!