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.

Additional <strong>NetView</strong> Pipeline Examples<br />

END<br />

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

/* Use parm1 to create a joblist */<br />

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

i = LENGTH(jobname)<br />

IF SUBSTR(jobname,i,1) = ’*’ THEN<br />

DO<br />

/* If using wildcard */<br />

jobname = STRIP(jobname,T,’*’) /* Remove ’*’ from jobname.*/<br />

i=i-1<br />

END<br />

ELSE<br />

/*Decrement removed ’*’ from leng.*/<br />

DO<br />

jobname = jobname || ’ ’<br />

/* If not using wildcard */<br />

/*Add’’tojobname so we do not */<br />

/* match other jobs that start with*/<br />

/* the characters of our jobname. */<br />

i=i+1<br />

END<br />

/*Increment added ’’tolength. */<br />

/* Issue MVS $DA command on the */<br />

/* NETVIEW stage to get info about */<br />

/* active batch jobs and jobs */<br />

/* waiting <strong>for</strong> resources. The cmd */<br />

’PIPE NETV MVS $DA,ALL,L=Z’, /* results will come back to the */<br />

, /* pipeline as 1 MLWTO (L=Z). */<br />

’ | CORR 30’, /* Wait 30 seconds <strong>for</strong> $DA output. */<br />

’ | TAKE 1’, /* Terminate wait when response */<br />

, /* received. */<br />

’ | SEP’, /* Split up lines of MLWTO. */<br />

’ | DROP FIRST 1’, /* Discard the first line. */<br />

’ | LOC 10.’i+10’ \’jobname’\’, /* Locate msgs containing jobname. */<br />

’ | STEM jobline.’ /* Store matching lines in */<br />

/* stem variable named jobline */<br />

/* */<br />

/* */<br />

/* Issue MVS $DN command on the */<br />

/* NETVIEW stage to get info about */<br />

/* jobs waiting <strong>for</strong> execution. The */<br />

’PIPE NETV MVS $DN,ALL,L=Z’, /* results will come back to the */<br />

, /* pipeline as 1 MLWTO (L=Z). */<br />

’ | CORR 30’, /* Wait 30 seconds <strong>for</strong> $DN output. */<br />

’ | TAKE 1’, /* Terminate wait when response */<br />

, /* received. */<br />

’ | SEP’, /* Split up lines of MLWTO. */<br />

’ | DROP FIRST 1’, /* Discard the first line & last */<br />

’ | DROP LAST 2’, /* 2 lines of $DN,ALL response. */<br />

’ | LOC 10.’i+10’ \’jobname’\’, /* Locate msgs containing jobname. */<br />

’ | STEM jobline. APPEND’ /* Append matching lines to con- */<br />

/* tents of stem variable jobline. */<br />

IF jobline.0 = 0 THEN /* if no matches, say so and exit */<br />

DO<br />

SAY ’No jobs found’<br />

SIGNAL GETOUT<br />

END<br />

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

/* Info on matching jobs creating */<br />

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

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

/* Display output */<br />

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

/* Use STEM stage to read matched */<br />

’PIPE STEM jobline.’, /* output into pipeline. */<br />

’ | COL’, /* Gather all output into 1 MLWTO. */<br />

’ | CONS ONLY’ /* Display. Do not automate or log.*/<br />

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

Appendix. Additional <strong>NetView</strong> Pipeline Examples 359

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

Saved successfully!

Ooh no, something went wrong!