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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Return Codes<br />

The following return codes are reported when the MOE operand is used.<br />

Examples<br />

Return Code<br />

Meaning<br />

8 A timeout occurred (message interval exceeded).<br />

12 A GO command was entered.<br />

16 A task executing a thread terminated.<br />

32 An ABEND occurred on a task executing a thread.<br />

Example: Causing a Wait with CORRWAIT<br />

To display We will now wait 9 seconds. and wait <strong>for</strong> nine seconds, enter:<br />

PIPE CORRWAIT 9<br />

| LITERAL /We will now wait 9 seconds./<br />

| CONSOLE<br />

Example: Using CORRWAIT to Wait <strong>for</strong> Messages<br />

To issue the <strong>NetView</strong> LIST STATUS=OPS command <strong>for</strong> a logical unit (LU) named<br />

A157C9 in a remote domain, allow 60 seconds <strong>for</strong> each resulting asynchronous<br />

message to return to the pipeline and display the results, enter:<br />

PIPE NETVIEW RMTCMD LU=A157C9,LIST STATUS=OPS<br />

| CORRWAIT 60<br />

| CONSOLE<br />

Example: Terminating a CORRWAIT<br />

An important consideration in using CORRWAIT with non-<strong>NetView</strong> commands,<br />

such as VTAM and MVS commands, is proper termination of the wait. Allowing a<br />

timeout to occur can result in lost messages. Instead, explicitly end the CORRWAIT<br />

with a following T<strong>OS</strong>TRING, TAKE FIRST, or GO command.<br />

When the last expected message can be detected by a simple comparison or count,<br />

use T<strong>OS</strong>TRING or TAKE FIRST after the CORRWAIT stage. When more<br />

complicated conditions apply, use the GO command.<br />

In this example, we expect two VTAM ACTIVE messages. We terminate<br />

immediately on receipt of IST061I VARY ACT...FAILED message, but if good<br />

responses are received, we must count them.<br />

Note: Certain VTAM message IDs are release dependent.<br />

PIPE VTAM V NET,ACT,SCOPE=ALL,ID=NTFELN7E<br />

| CORRWAIT 100<br />

| T<strong>OS</strong>TRING 1.7 /IST061I/<br />

| SAFE VTAMRESP<br />

| LOCATE 1.7 /IST093I/<br />

| DROP 1<br />

| PIPEND 0<br />

PIPE CORRWAIT<br />

The desired termination condition is stop as soon as you receive IST061 (failure<br />

message) or when you receive the second IST093. Notice that the first VTAM<br />

ACTIVE message is dropped after being stored in a name SAFE <strong>for</strong> later<br />

examination. The second VTAM ACTIVE message that is received drives PIPEEND<br />

0, which causes the pipeline to end with a0return code.<br />

Still more complex termination decisions can require you to drive a command<br />

procedure from a NETVIEW stage following your CORRWAIT. This procedure can<br />

Chapter 2. Pipeline Stages and Syntax 57

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

Saved successfully!

Ooh no, something went wrong!